Building Custom Docker Images
Practice building custom Docker images from your Dockerfiles and pushing them to a registry.
Build & Push Docker Images
Welcome back! In the previous lesson, you learned to write Dockerfiles. Now, let's turn those Dockerfiles into real Docker images and share them!
We'll cover how to:
- Use the
docker buildcommand - Tag your images for versioning
- Log in to a Docker registry
- Push your custom images for others to use
The `docker build` Command
The docker build command is your tool for creating Docker images from a Dockerfile and a "build context."
- It reads the instructions in your Dockerfile.
- It executes each instruction, creating a new layer in the image.
- Finally, it produces a new Docker image.
The basic syntax is docker build [OPTIONS] PATH | URL.
All lessons in this course
- Crafting Dockerfiles for Images
- Building Custom Docker Images
- Multi-Container Apps with Compose
- Persisting Data with Docker Volumes