Have you failed a job interview?
Send us your job interview questions and get correct answers.

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.

Comments

No Comments Yet.
Be the first to tell us what you think.
Docker instructions
Docker instructions

Are you learning Docker ? Try our test we designed to help you progress faster.

Test yourself