Harbor for Beginners, Part 4: Tag an Image and Understand Versions

The three words you keep seeing in Harbor, explained by adding a second tag to the image you pushed. See how one artifact can carry many tags, and why a digest is the real identity.

Harbor for Beginners · Part 4 of 12

In Part 3 you pushed an image and it showed up in your project. Three words got thrown around on that screen, repository, artifact, and tag, and they are easy to mix up. This part clears them up the best way there is: by doing something small and watching what happens. We will add a second tag to the image you already have and see how Harbor shows it.

Three words: repository, artifact, tag

Here is the whole vocabulary, with your own project as the example.

WordWhat it really isIn your project
RepositoryA named shelf that holds one image and all its versions.hello-world
ArtifactThe actual image content, identified by a long sha256 digest. This is the real thing.the item tagged v1
TagA friendly label stuck on an artifact. You read and type tags; the digest is what they point to.v1, and soon v2

The one idea to hold onto: a tag is just a sticky note. The artifact is the box it is stuck to. You can put several sticky notes on the same box.

Look at what you pushed

Open your project, click into hello-world, and look at the artifact row. It has one tag, v1, a size, and that long sha256 digest. The digest is the artifact’s true name. The tag is just the label you gave it.

The hello-world artifact with a single v1 tag
One artifact, one tag. The sha256 digest is its real identity.

Add a second tag

Back in the Jupyter terminal (run the crane auth login again if it is a fresh terminal), stick a second label on the very same image. This uploads nothing new, it just adds a pointer.

./crane tag registry.lab.internal/pranay-project/hello-world:v1 v2 --insecure

That command says: take the image currently tagged v1 and also call it v2. Same bytes, new label.

One image, two tags

Refresh the artifact view in Harbor. The same row now shows two tags, v2, v1, and they sit on the same digest. Look at the bottom of the table: it still says 1 of 1 items. You did not add a second image. You added a second name for the one image you already had. That is the whole point of tags.

The same artifact now showing both v2 and v1 tags
Two tags, one artifact. Same digest, same size, still a single item.

This is why people say tags are cheap and digests are forever. You can move a tag like latest from one image to another whenever you want. The digest never changes, because it is calculated from the content itself. If two images have the same digest, they are byte-for-byte identical.

Pull by tag, or pull by digest

Harbor will hand you the exact command to fetch an image. Click the small copy icon next to the artifact and it drops a pull command onto your clipboard. Notice that the one Harbor gives you uses the @sha256:... digest, not a tag.

A banner confirming the pull command was copied, using the digest
The copied pull command points at the digest, the version that can never drift.

Both styles work. Pulling hello-world:v1 is friendly and readable. Pulling hello-world@sha256:... is exact and can never point at the wrong thing, even if someone moves the tag later. Tags for humans, digests for machines and anything that has to be certain.

What to remember

  1. A repository holds one image and all its versions.
  2. An artifact is the real content, named by its digest.
  3. A tag is a label pointing at an artifact, and many tags can point at one.
  4. Use tags when you want something readable, and digests when you want something that cannot change underneath you.

Harbor for Beginners, Part 4 of 12. Product names belong to their owners. The host shown is a stand-in, not a real value.

About The Author


Discover more from Journal of Intelligent Infrastructure – By Dr Pranay Jha

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Architect’s Toolkit

About the Author

Dr. Pranay Jha is a Cloud and AI Consultant with 18+ years of experience in hybrid cloud, virtualization, and enterprise infrastructure transformation. He specializes in VMware technologies, multi-cloud strategy, and Generative AI solutions. He holds a PhD in Computer Applications with research focused on Cloud and AI, has published multiple research papers, and has been a VMware vExpert since 2016 and a VMUG Community Leader.

Discover more from Journal of Intelligent Infrastructure - By Dr Pranay Jha

Subscribe now to keep reading and get access to the full archive.

Continue reading