Docker Tags, Registries, and User Identity

I’ve been spending a good deal of time recently building Docker images, and pushing them around between development and deployment environments. The Docker command line interface can feel awkward, and in some cases, confusing until you really understand what’s going on. While Docker’s tutorial is good, the command documentation often left me asking why

Image Registries

Say you’ve created an image and are ready to share it. The most common way to do this is to push it to a registry, from which you or others can pull it to a target machine for deployment.

Image Tagging

Docker image tags are metadata strings that include multiple sets of information. The Docker tag command is described as:

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

Anatomy of an Image Tag

A conventional image tag has a schema like this:

The Docker Tag Command

A source of confusion for me has been an apparent recursion in the Docker tag command description:

2 tags for image 4f98c0d6d5d4

Docker Operations Through Tags

Now that the we have attached metadata to the image with the docker tag command, we can perform operations that reference the information it contains. For instance, if you want to push this to your private registry, you would just use the Docker push command, specifying the tag that we just created:

Tagging and pushing an image to my Dockerhub repository

Final Thoughts

Most command line interfaces would gather necessary information to satisfy a request through positional arguments and/or named parameters. This is the first interface I remember using that attaches this kind of information to the object which is being acted upon.

I’m a software developer and architect, with an enthusiasm for AI and deep learning. Always looking for the next thing …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store