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.

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:2image and confirm it via the registry's HTTP API. - Apply a multi-tag versioning strategy (semver,
latest, short SHA) to a single image usingdocker tag. - Push tagged images to the local registry and inspect the resulting
/v2/_catalogand/v2/{name}/tags/listendpoints. - Pull an image back from the registry after deleting it locally, confirming the registry round-trip works.
- Reference an image by its immutable
sha256digest and explain when to prefer digests over tags. - Reclaim disk space with
docker image pruneand 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.
More labs like this
Deploying Azure Container Apps with Docker Hub Images
Learn to deploy containerized applications in Azure using Docker Hub images.
Publish and Consume Bicep Modules with Azure Container Registry
Create a private Bicep module registry using ACR to publish, version, and consume reusable infrastructure modules across deployments.
Containerize and Deploy a Multi-Container Application to Azure Container Apps
Build Docker images for a restaurant menu app, push to ACR, and deploy frontend and backend containers to Azure Container Apps.
Related reading
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Getting Started with Docker IDE
- 02
Run a Self-Hosted Docker Registry Container
1 automated check
- 03
Tag an Image with a Versioning Strategy
1 automated check
- 04
Push Tagged Images to the Local Registry
1 automated check
- 05
Pull an Image and Reference It by Digest Then Prune
1 automated check
Skills validated
Not the lab you were looking for?
Browse 200+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.