Skip to content

DOCKER_05

Fredrik Grönqvist edited this page Apr 22, 2021 · 1 revision

DOCKER_05

Description

Although ADD and COPY are functionally similar, generally speaking, COPY is preferred. That’s because it’s more transparent than ADD. COPY only supports the basic copying of local files into the container, while ADD has some features (like local-only tar extraction and remote URL support) that are not immediately obvious. Consequently, the best use for ADD is local tar file auto-extraction into the image, as in ADD rootfs.tar.xz /.

https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy

Clone this wiki locally