As part of my ci-perl-helpers project I generate a whole bunch of Docker images. Specifically, every time I push to a branch (including master) or a tag, I make 96 images. There is one base image and then one image for each specific version of Perl (5.8.9, 5.10.1, 5.12.0, etc.) plus a blead image. For each version of Perl I build a perl binary with and without threads. Obviously the number of images will only grow over time.
I tag these images with the version of Perl, whether it has threads, and also with an indicator of the branch or tag of my project that I’ve built. So for example when I push to master I build an image tagged
5.30.1-master and another tagged
5.24.1-threads-master and so on. If the commit also has a Git tag I push the image again with an image tag including the Git tag instead of the branch, for example
I’m effectively putting three independent variables into a single string. I have information about the Perl version, about the perl binary’s compilation options, and about the version of the helpers code in the image.
Right now all of these images are built using
ubuntu:bionic as the base but I was thinking that it would be nice to also build some images with other bases. So then I’d have tags like
This just feels gross. Of course, I could also add
LABEL lines to the Dockerfiles for each image to add this metadata but that doesn’t achieve much. When I look at my repository on Docker Hub I can only search by tag. I can’t use the labels when I run
docker pull either. Docker Hub doesn’t even show the labels in its web UI!
I see this sort of pattern all over Docker Hub. People encode lots of information in tags, leading to hard to remember and hard to read tagging schemes. The perl Docker repo is a great example. The tags encode the version of Perl, whether it has threads, and an indication of the Debian base image used for the image.
I think the solution is simple, conceptually. Encourage people to use consistent
LABEL schemes and make it possible to search and pull images based on those schemes. It’s easy for me to say that, but I’m sure there are lots of usability issues to be discovered with this idea.
But surely there must be a better way to provide this sort of information than these ridiculously overloaded tags.