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

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…

Contents