What is a difference between COPY and ADD instructions in Docker?
Experience Level: Senior
Tags: Docker
Answer
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.
Related Docker job interview questions
What instructions do you use in Dockerfile to a previous stage as a new stage?
Docker SeniorWhat is the LABEL instruction good for in Docker?
Docker SeniorWhat is the ADD instruction good for in Docker?
Docker SeniorWhat is the STOPSIGNAL instruction good for in Docker?
Docker SeniorWhat is the SHELL instruction good for in Docker?
Docker Senior