Skip to content

Docker image tagging and naming

Docker image tagging and naming conventions define how container images are identified, stored, and retrieved within a [[Container registry]]. The format typically combines a registry hostname, a namespace or username, and an image name, followed by a tag^[query-io.md].

Image Syntax

A full image reference generally follows the structure: REGISTRY/NAMESPACE/IMAGE_NAME:TAG

For example, in the string quay.io/tommyunistar/yudady, the components are broken down as follows^[query-io.md]:

  • Registry (quay.io): The domain hosting the image.
  • Namespace (tommyunistar): The user or organizational account within the registry.
  • Image Name (yudady): The specific name assigned to the image.

Tags

Tags are used to identify specific versions or iterations of an image. If a tag is not explicitly specified during a push or pull operation, Docker defaults to using the latest tag^[query-io.md].

The latest tag acts as a default identifier but does not necessarily imply the most recently created version; it simply points to the version tagged as latest in the repository^[query-io.md].

Workflow Examples

When interacting with a registry like Quay.io, the naming and tagging process typically involves the following steps^[query-io.md]:

  1. Committing an image: A container ID (e.g., e23d4b149bf0) is committed to a named repository (e.g., quay.io/tommyunistar/yudady).
  2. Pushing: The image is uploaded to the registry. If no tag is provided in the command, the system automatically appends the :latest tag.

Sources

^[query-io.md]