From the course: Docker for Data Engineers

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Building your first Docker image

Building your first Docker image - Docker Tutorial

From the course: Docker for Data Engineers

Building your first Docker image

So far, we've pulled images that others have shared on Docker Hub and created containers using those images. We are now ready to build our first image. Now here I am in the /docker-demos folder, and within this folder, I have a single file, the Dockerfile. The Dockerfile contains all of the instructions that I'm going to use to build my very first image, and here is what this Dockerfile looks like. You can see this Dockerfile is very simple. There are just two Docker directives or two instructions in this image from alpine:latest and the CMD command. Let's focus on the first command, the FROM alpine:latest. The FROM command in a Dockerfile specifies the base image that your Docker image will build upon. alpine:latest is a base image that's available in Docker Hub. We'll use that base image to build up the rest of our image. This base image will serve as the first layer in our image. This is the first layer in our image and sets the foundation for subsequent layers. And the FROM…

Contents