A Docker build that worked yesterday fails with "COPY failed: file not found in build context or excluded by .dockerignore: stat config/app.yaml: file does not exist".

BeginnerTroubleshootingPipeline outages
Answer

Likely causes → A recent change added a pattern to .dockerignore that excludes the file (a broad config/ or *.yaml), the file moved, or the build runs from a different directory so the context isn't what the Dockerfile expects.

Diagnose →

git log -3 -p -- .dockerignore
cat .dockerignore
docker build --progress=plain -f Dockerfile . 2>&1 | grep -i 'transferring context'

Fix → Narrow the ignore rule or add an exception (!config/app.yaml), or fix the build context path in the pipeline (docker build -f docker/Dockerfile .).

Prevent → Keep the Dockerfile and its context next to each other and build the image in PR checks, so ignore-file changes are caught before merge.

All Real-World Interview questions Roadmap: Interview readiness

More on Pipeline outages