โก Fun fact: ๐ Ansible 2.9 is amazing! ๐
๐พ ๐พ ๐พ ๐พ
Find Version Tag for Latest Docker Image
Home Page: https://ryandaniels.ca/blog/find-version-tag-latest-docker-image/
License: MIT License
Hi, I was reading your blog post that goes with this script. If you wanted to get the version associated with an image that is also tagged 'latest', you should be able to do the following...
IMAGEID=sha_of_image
docker image inspect $IMAGEID | jq -r '.[].RepoTags'
for example, when I do this on a postgres image I have, I get the following...
[
"postgres:13.2",
"postgres:latest"
]
Note, this works on most 'mainstream' (ie popular) images as its considered a best practice. If the maintainer doesn't full that, then your script will be needed to try and figure out what 'latest' is.
https://index.docker.io/v2 requests authentication
For example the command:
./docker_image_find_tag.sh -n portainer -i 5526251cc61f -f 2.13. -l 10 -v
outputs:
Using IMAGE_NAME: portainer
Using REGISTRY: https://index.docker.io/v2
Found Image ID Source: sha256:5526251cc61f126f2c1da1875aae113c9af05a5679123dde2f6c15d12754b103
Error 401 from: https://index.docker.io/v2/library/portainer/tags/list
HTTP_BODY: {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"library/portainer","Action":"pull"}]}]}
I'm trying to use docker_image_find_tag.sh, and can't get it to work even with one of your examples:
$ docker_image_find_tag.sh -n traefik -i 96c63a7d3e50 -f 1.7. -l 10 -v
Using IMAGE_NAME: traefik
Using REGISTRY: https://index.docker.io/v2
parse error: Invalid numeric literal at line 2, column 4
I'm running this on a Windows 10 system, using Ubuntu via WSL 2.
At first the script failed because jq
wasn't recognized, but once I installed that I couldn't get any further than the error above.
I got the error when execute this command. thanks!
docker_image_find_tag.sh: line 175: CURL_AUTH[@]: unbound variable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.