`docker build` fails with "COPY failed: file not found in build context". Fix it.
BeginnerHands-onLive debugging tasks
Answer
docker build -t app -f docker/Dockerfile . # context is "." (repo root), not docker/
cat .dockerignore # is the file excluded?
Paths in COPY are relative to the build context (the last argument), not to the Dockerfile's location, and files listed in .dockerignore are invisible to the build.
Key trick → Run from the repo root with -f path/to/Dockerfile, and check .dockerignore before anything else.
More on Live debugging tasks
A pod is in CrashLoopBackOff. You have 10 minutes. Walk through your commands.BeginnerThe pod shows `OOMKilled`. Diagnose and fix it.BeginnerA pod is stuck in `ImagePullBackOff`. Fix it.BeginnerA pod is `Pending` forever. What do you check?AdvancedThe Service returns "connection refused" but pods are Running. Debug it.IntermediateA Docker container exits immediately after `docker run -d`. Find out why.Beginner