From the course: Docker for Data Engineers
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Running the containerized Python application - Docker Tutorial
From the course: Docker for Data Engineers
Running the containerized Python application
We've seen the different parts needed to build a containerized application, including the Dockerfile. The image built using this Dockerfile will have a total of four layers. The first layer comes from the FROM directive, which specifies the base image. The second layer comes from the WORKDIR command, which specifies the working directory of the application. The third layer comes from the COPY command, which copies the contents from the host machine into the container. And the fourth and last layer comes from the RUN command, which installs libraries that are baked into the container image. Let's verify this by heading over to our terminal window and using docker build to build an image called my-python-app using the Dockerfile that we've just looked at. Executing this command will start building the layers of the image. Observe that there are a total of four layers built. The first layer is the base python layer and observe that it says cached. That's because we have previously used…
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
-
-
-
-
-
(Locked)
Building your first Docker image5m 46s
-
(Locked)
Overriding the CMD instruction1m 52s
-
(Locked)
Using the Python base image5m 18s
-
(Locked)
Running a container in interactive mode2m 29s
-
(Locked)
Specifying the Dockerfile to run a Python application6m 36s
-
(Locked)
Running the containerized Python application5m 7s
-
(Locked)
Running multiple containers from the same image3m 28s
-
(Locked)
Building an image that runs a setup script6m 14s
-
(Locked)
Overriding the ENTRYPOINT directive4m 38s
-
(Locked)
-
-
-