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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Introduction to Dockerfiles1m
-
(Locked)
The anatomy of a Dockerfile4m 37s
-
(Locked)
Sourcing other Docker images with FROM4m 32s
-
(Locked)
Building your first image3m 59s
-
(Locked)
Adding and copying files with COPY and ADD3m 51s
-
(Locked)
Updating the image5m 22s
-
(Locked)
Customizing your Docker image with RUN7m 46s
-
(Locked)
Starting your app with ENTRYPOINT9m 25s
-
(Locked)
"Starting" your app with CMD7m
-
(Locked)
Adding variables with ENV and ARG9m 39s
-
(Locked)
Other helpful Dockerfile commands5m 36s
-
(Locked)
Multi-stage builds9m 57s
-
(Locked)
Multi-platform images15m 10s
-
(Locked)
Multi-app images8m 8s
-
(Locked)
Challenge: Build and run your first image2m 1s
-
(Locked)
Solution: Build and run your first image5m 54s
-
-
-
-
-
-
-
-