Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I identify what tags are associated with a docker image_id?

If I specify in my docker compose file that I want to use homeassistant/home-assistant as my image, it will use the "latest" tag.

Now ten days later, lets assume “latest” has changed. If I want to update to the current latest, that’s easy enough. But if I later want to revert to using the same image before I updated, I have no way of knowing what “latest” was 10 days ago.

docker images

will give me the image_id. Since the developer of this image also tags images with version numbers, how can I find out what other tags are associated with a specific image ID?

In the grand scheme of things, I’d like to be able to rebuild all of my containers with the images I had specified as they existed on a particular date/time. If one uses the “latest” tag in docker compos, how can this be achieved?

like image 731
WhiskerBiscuit Avatar asked Oct 18 '25 09:10

WhiskerBiscuit


1 Answers

Using the "latest" tag is not really considered good practice, for exactly the reason you are describing. You probably need to get a list of images with their digests.

docker image ls IMAGE --all --digests

Once you have the digest you can pin your image using the digest format homeassistant/home-assistant@sha256:45bc9ec36.... See docker pull docs for more info.

like image 173
Ryan Avatar answered Oct 19 '25 22:10

Ryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!