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.
Using the Python base image - Docker Tutorial
From the course: Docker for Data Engineers
Using the Python base image
We built our first image using the Alpine Linux distribution as our base layer. But what if you want to run a Python app within a container? Your base layer needs to have Python installed. If you want your containers to run Python applications, it's common practice to use a Python image as your base layer. Here I am on Docker Hub and I've searched for Python. You'll find that Docker Hub has an official Python image for the different versions of Python that you might want to use, and you can use this as the base layer for your container. Observe that this Python image is a Docker official image. You can see that right next to the name of the image. Let's head over to tags to see what versions of this image are available. Now you can see that an image was recently released and has been tagged using the latest tag. Now, you can choose to use this as the base image within your container, but a production best practice is to explicitly specify the version of the image that you want to use.…
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)
-
-
-