From the course: Docker Essential Training
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Customizing your Docker image with RUN - Docker Tutorial
From the course: Docker Essential Training
Customizing your Docker image with RUN
- [Instructor] A Docker image would be pretty useless if we could only copy files into it. Fortunately, the RUN Command provides a really flexible way for us to customize and configure our image. The RUN command runs shell commands within temporary containers. These containers are created from image layers generated by the Docker file commands that preceded them. Here are a couple of files to explain what I mean. Right now, our Docker file looks kind of like the first two lines in this image here. It only contains the FROM commands that will link layers within the latest Ubuntu image to our Docker file, and a COPY command that creates a new layer on top of that, which will contain our exercise files in a directory called /app. Now, let's say we wanted to throw in a RUN command that does something that we want like say RUN stat /app. Because RUN runs shell commands and containers, when Docker sees this line in our Docker file,…
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
-
-
-
-
-
-
-
-