Hands-On LabIntermediate

Build and Push Images to a Container Registry with Docker

Tag, push, and pull Docker images using a self-hosted registry, applying semver, latest, and content-addressed digest references.

45 minEstimated time
5Guided steps
AutoVerification
IsolatedSandbox
Build and Push Images to a Container Registry with Docker

Lab overview

Container registries are the storage layer of the container ecosystem — the catalog that turns a one-off docker build into a deployable artifact a team or CI/CD pipeline can pull from anywhere. Every production container workflow eventually pushes an image to a registry, whether that registry is Docker Hub, Azure Container Registry, AWS ECR, GitHub Container Registry, or a private self-hosted one. Without a registry, an image stays trapped on the machine that built it, and there is no way to promote it through environments, deploy it to Kubernetes, or distribute it to other engineers.

Just as important is how images are referenced. A tag like myapp:1.0 looks immutable but is really a moving pointer — whoever pushes next to that tag overwrites it for everyone. Production-grade workflows pin to a content-addressed digest (myapp@sha256:abc...) because the digest is cryptographically derived from the image bytes and can never change.

In this lab, you will run your own Docker registry using the official registry:2 image, apply a real-world versioning strategy (semver, latest, and a commit SHA) to a base image, push and pull it from the local registry, inspect the registry's HTTP API to see what was stored, reference an image by its immutable digest, and clean up unused image layers with docker image prune.

Objectives

Upon completion of this intermediate level lab, you will be able to:

  • Run a self-hosted Docker registry on the lab VM using the official registry:2 image and confirm it via the registry's HTTP API.
  • Apply a multi-tag versioning strategy (semver, latest, short SHA) to a single image using docker tag.
  • Push tagged images to the local registry and inspect the resulting /v2/_catalog and /v2/{name}/tags/list endpoints.
  • Pull an image back from the registry after deleting it locally, confirming the registry round-trip works.
  • Reference an image by its immutable sha256 digest and explain when to prefer digests over tags.
  • Reclaim disk space with docker image prune and reason about safe cleanup in CI environments.

Who is this lab for?

This lab is designed for:

  • Developers and DevOps engineers who can already build and run a basic Docker image and now need to understand how images move through a registry — tagging conventions, push/pull mechanics, content addressing, and cleanup.
  • Platform engineers preparing to adopt a managed registry like Azure Container Registry, AWS ECR, or GitHub Container Registry. The OCI Distribution API exercised here is the same one those commercial registries expose.
  • CI/CD practitioners building image-promotion pipelines who want to understand the difference between mutable tags and immutable digests before they pin a Kubernetes deployment to either.

Verified against your live environment

An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed, not multiple choice, real-world proficiency.

[CHECK] validation_activelive
Inspecting deployed resources...
Verifying configuration state...
✓ Step requirements satisfied

More labs like this

Related reading

PremiumIncluded in Premium
Duration
45 min
Steps
5

Environment

Dedicated VM IDE

Every lab includes

  • Real environment, pre-credentialed
  • Automated checks on every step
  • Isolated sandbox, auto cleanup
  • AI-recommended next steps

Lab curriculum

  1. 01

    Getting Started with Docker IDE

  2. 02

    Run a Self-Hosted Docker Registry Container

    1 automated check

  3. 03

    Tag an Image with a Versioning Strategy

    1 automated check

  4. 04

    Push Tagged Images to the Local Registry

    1 automated check

  5. 05

    Pull an Image and Reference It by Digest Then Prune

    1 automated check

Skills validated

Azure Container RegistryDocker

Not the lab you were looking for?

Browse 200+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.

Explore the catalog