
COPY versus ADD in a Dockerfile
Choose ordinary copies, local archive extraction, remote downloads, or build-stage copies without relying on outdated cache advice.
Focused answers for definitions, architecture choices, troubleshooting, pricing, and evaluation.

Choose ordinary copies, local archive extraction, remote downloads, or build-stage copies without relying on outdated cache advice.

Identify the selected engine and API endpoint before changing socket mounts, Linux permissions, or Windows named-pipe access.

Make a controlled temporary edit, validate the application configuration, and carry the change back into reproducible deployment files.

Choose exec, cp, export, diff, or an image snapshot while accounting for mounted data and consistency limits.

Separate daemon socket access from filesystem permissions, group membership, rootless contexts, and SELinux labels.

Use no-cache and pull deliberately, invalidate selected build steps, and distinguish cache avoidance from reproducibility.

Inspect addresses by network, distinguish IPv4 and IPv6, and avoid confusing a container address with a published host endpoint.

Use full-line comments, distinguish shell parsing from Dockerfile parsing, and place parser directives before ordinary content.

Understand cron job environments and pass selected values without treating an unescaped environment dump as a shell script.

Check host addressing, protocol, listener binding, and firewall rules before confusing container-to-host access with port publishing.

Preserve existing data and configuration, recreate with the new mount, and verify storage before removing the old container.

Recreate a container with the new port mapping while preserving configuration and data, or use a deliberately managed proxy.