Skaffold "docker build failed" in CI
Skaffold ran your Dockerfile through the docker builder and the build exited non-zero. Skaffold reports "docker build failed", but the actionable cause, a failing RUN, a missing file, or a bad base image, is in the streamed build log above.
What this error means
A build step ends with "building [my-app]: docker build failed" preceded by a Docker build error such as a failed RUN command or missing COPY source.
building [my-app]: docker build failed:
> [4/6] RUN npm ci:
process "/bin/sh -c npm ci" did not complete successfully: exit code: 1Common causes
A build step inside the Dockerfile failed
A RUN command (install, compile, test) exited non-zero, which fails the whole image build.
A missing COPY source or bad build context
A file referenced by COPY is not present in the build context, often because CI checks out a different set of files than a local build.
How to fix it
Read the failing build stage
- Scroll to the numbered stage
[n/m]that failed in the log. - Reproduce that RUN or COPY locally to see the real error.
- Fix the Dockerfile or add the missing context file, then re-run.
Verify the build context in CI
Ensure the files the Dockerfile copies are present after checkout and not excluded by .dockerignore.
skaffold build -v debug --default-repo=us-docker.pkg.dev/my-project/my-repoHow to prevent it
- Reproduce the exact Dockerfile build locally before pushing.
- Keep .dockerignore in sync with what the Dockerfile expects.
- Pin base image tags so a moved tag does not change the build.