March 25, 2017

Docker Tag

Docker Tag

  • A tag is simply an alphanumeric identifier attached to the image, and used to distinguish one image from another
  • A tag name must be valid ASCII and contain lower or uppercase letters, digits, underscores, periods and dashes


  • The nginx repository on the official Docker registry contains multiple images.
    Note that the same image may have multiple tags, e.g. the alpine stable image has three tags (:1.10.3, :stable, :1.10) that all point to the same image.

    One way to verify that two or more images are identical is if they have the same SHA256 digest. All three tags of the alpine stable image have the same SHA256 digest: f829870f13c0b5471083fb59375fd914cf2597d814175bf1b7e868e191be210b

    Note: if you run $ docker pull nginx you get the “latest” image, which happens to be in the mainline tree. I.e. the above command does the equivalent of $ docker pull nginx:latest
  • The latest tag applies to an image that was built last and pushed onto the repository without a specific tag provided.
  • The latest tag is used as the default tag if no tag is specified when pushing an image to a repository
  • If you pull an image without specifying a tag, you will get the image tagged latest.
  • The more complete format of an image name is shown here:
  • [REGISTRYHOST:[PORT]/[_/][USERNAME/]REGISTRYNAME[:TAG]
    Here are some examples:
      docker pull localhost:5000/hello-world hello-world image on the local registry
      docker pull nginx nginx image from the official Docker Hub registry
      docker pull nginx:1.11 nginx image with tag 1.11 from the official Docker Hub registry
      docker pull registry.access.redhat.com/rhel-atomic rhel-atomic image from the official Red Hat registry

No comments:

Post a Comment