From the course: Docker Essential Training

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Adding and copying files with COPY and ADD

Adding and copying files with COPY and ADD - Docker Tutorial

From the course: Docker Essential Training

Adding and copying files with COPY and ADD

- [Instructor] We often find ourselves wanting to include files and folders into our images. Fortunately, the Docker file language makes this easy to do with the COPY and ADD instructions. COPY copies files and directories within the context provided to Docker image build into a layer within our Docker image. ADD is an older version of the COPY command with two key differences. First, it can automatically decompress tar files from a website into the folder provided and it can automatically download tar files from a URL. Why are there are two commands that do the same thing? Well, to answer that, we need to go back in time a little bit. In 2017, the Docker file maintainers thought that ADD was becoming too large of a command and wanted to use a new command that focused only on copying files into Docker images. However, by this point, Docker was beginning to take the world by storm and many hundreds of thousands of Docker…

Contents