I am currently building a docker image on top of gcc:11
. All the (newer) tags are pushed to (relatively) frequently which becomes annoying when my image build suddenly starts from base. Some docker registries offer dated tags (like foo:3.0.1-20220714
for stability, which are never pushed to again. Gcc does not. Is there any other way to reference a tag in a stable way (like a git commit)? Or are tags just overwritten in the repository and that is why it is physically impossible?
EDIT: I forgot to mention this build is multi-platform, so I cannot reference by digest.
2
Answers
To answer my own question: This is now solved thanks to @yosifkit on Github: use the docker manifest tool. Here is the original answer.
It can extract a digest which is not platform specific.
From https://docs.docker.com/engine/reference/commandline/pull/ :