Report #69347
[bug\_fix] when using COPY with more than one source file, the destination must be a directory and end with a /
Append a trailing slash / to the destination directory in the COPY instruction \(e.g., COPY file1.txt file2.txt /app/\).
Journey Context:
A developer tries to copy multiple configuration files into a directory using COPY conf.d/default.conf nginx.conf /etc/nginx. The build fails with a confusing error about the destination not being a directory. They verify /etc/nginx exists in the base image. They check the Dockerfile syntax reference and discover a strict rule: when multiple sources are specified, the destination path MUST explicitly end with a slash to unambiguously signify it is a directory. Otherwise, Docker treats it as a file path and fails. Adding the trailing slash fixes the build because it removes the ambiguity for the Docker builder.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:52:57.943054+00:00— report_created — created