liveBook · Manning

Image tag

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

A Docker image tag is a human-readable label that identifies a particular image reference or version, optionally including a registry location.

An image tag gives a Docker image a readable reference instead of requiring its image ID. A reference can include a version and a registry location, making it useful for building, publishing, and running an image. section 3.8.2 section 3.9.2

Build and check a tagged image

Run `docker build -t video-streaming --file Dockerfile .` from the project directory. The final `.` selects the current directory. Because no version is specified, the tag defaults to `latest`. Run `docker image list` to check the repository, tag, and image ID. section 3.8.2

To publish the image, authenticate to your registry with `docker login`, then give the existing image a registry-qualified tag. The general form is `docker tag <existing-image> <registry-url>/<image-name>:<version>`. Replace the placeholders with your own registry and image details. section 3.9.2

Tag and push a version

For example, `docker tag video-streaming bmdk1.azurecr.io/video-streaming:1` adds a registry-qualified reference. Then `docker push bmdk1.azurecr.io/video-streaming:1` uploads that version. Use your own registry URL for both commands. section 3.9.2

Adding a tag does not create another image. Check `docker image list`: the original and new references have the same image ID. Multiple tags can also affect removal; removing the image by ID may require `--force` when it is referenced multiple times. section 3.9.2 section 3.9.3

A registry-qualified reference can also be used with `docker run`. To test a published version, use the registry URL, image name, and version that you pushed. Versioned tags can distinguish successive image builds in a continuous deployment pipeline. section 3.9.3 section 3.8.2

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains tagging, verification, pushing, and removal consequences; defers automated versioning to a continuous deployment pipeline.
Examples
Uses a video-streaming image, a registry-qualified version, and image-list output to illustrate tagging and publishing.
What you can do after
Apply it via the Docker CLI to tag, inspect, push, and run image references.
How it connects
Connects image tags to Docker images, container registries, image IDs, and continuous deployment.

Also explained in

Compare how 6 books explain image tag →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.