Container builds
Why Docker COPY cannot find a file that exists on your computer
Trace build-context paths and Docker ignore rules locally, and distinguish a missing source from an excluded file or an unsupported COPY expression.
Docker reads local COPY sources from the build context. A file beside your Dockerfile can still be outside that context or excluded by an applicable ignore file.
The build context inspector examines supplied files locally and shows the source path and rule behind supported COPY findings. Use it to explain the files Docker can see before inspecting the resulting image archive.
Open Docker build context inspector →Supply the context used by your build command
docker build -f docker/Dockerfile .
# Dockerfile: docker/Dockerfile
# Context: the current directorySelect the real context folder or a ZIP preserving its relative paths, then choose the Dockerfile and context path that correspond to your command. A report built from a different folder can explain a different build. The inspector does not run the command or connect to a Docker daemon.
Reference: Docker build context and ignore files
Follow the applicable ignore file
A Dockerfile-specific ignore file takes precedence over the context's root .dockerignore when present. Rule order and negation affect matching. Inspect the supplied rule locations and the reported path rather than assuming that an existing file must be included.
- Missing means no supported matching source was found in the supplied inventory.
- Excluded means an applicable ignore rule removed a matching source from the modeled context.
- Unsupported means the tool cannot establish the result for that expression or context; it is not a missing-file verdict.
Reference: Docker build context and ignore files; Docker CopyIgnoredFile build check
Keep local source findings separate from build execution
Stage copies, named contexts, remote sources and variable-dependent expressions require information beyond a literal local path. Follow the limitations on each finding. The report does not certify that an image builds, that runtime files exist or that an archive is free of secrets.
After a successful build, use the OCI image archive inspector to follow image layers and final paths in a supported local export. That answers a separate question from whether a source entered the build context.
Technical references
These primary sources explain the underlying formats and browser APIs. Tool-specific behavior and limits above describe the current Buddy Code implementation.
PUT IT INTO PRACTICE
Try it with your own setup.
Explain missing or excluded Docker COPY sources using a local folder, Dockerfile and ignore rules.
Open Docker build context inspector →