0PricingLogin
Docker & Kubernetes for Developers · Lesson

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 build command
  • 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

  1. Crafting Dockerfiles for Images
  2. Building Custom Docker Images
  3. Multi-Container Apps with Compose
  4. Persisting Data with Docker Volumes
← Back to Docker & Kubernetes for Developers