An image tag is an identifier appended to an image reference so Docker and a container registry can distinguish and locate a particular image version. Builds may receive random hash-based names, but meaningful tags make images easier to reference. section 3.2.2
Use tags for two related jobs:
- Identify a version, commonly with a number such as 1, 2, or 2.2.1. section 3.2.2
- Identify the registry, account, repository, and version required for an upload, such as us-docker.pkg.dev/wdenniss/ts/timeserver:1. section 3.2.2
- Select a new image for a Kubernetes Deployment; changing the tag from 1 to 2 causes Kubernetes to replace older Pods through its default rolling update strategy. section 3.2.7
Publishing version 1
Set IMAGE_TAG to us-docker.pkg.dev/wdenniss/ts/timeserver:1, tag the local timeserver image with that reference, build or push it, and use the same reference in the deployment configuration. Later, publish version 2 and update the Deployment image. section 3.2.2 section 3.2.7
IMAGE_TAG=us-docker.pkg.dev/wdenniss/ts/timeserver:1 docker tag timeserver $IMAGE_TAG
Shows how to assign a complete registry image tag to a local image before publishing it. section 3.2.2





