I have multiple images with the same name and I have built a script that lets me load an image from the tar and then get it’s tag and update the yaml file as well. The issue is, this only works if the image is the latest image in that name.
docker images "$image_name" --format "{{.Tag}}" | sort -rV | head -n 1
Sometimes I need to load an older image which could be older than the latest image. When in this situation I want to get the specific image I load.
eg: If i already have an image gui:test_v1.5 image but I need to load an older image from a tar such as,
docker load -i test_v1.0.tar
I can’t seem to get the tag of this image. Any possible ways to do that?
I need the tag name so i can auto update the yaml file using sed.