Sometimes we need to see all available release tags of docker image and we are too lazy to open the browser.
Then we can list available tags by executing below snippet. Make sure you have jq
installed:
#!/usr/bin/env bash
usage(){
echo "Usage: $0 [ -r repo ]" 1>&2
exit 0
}
while getopts ":r:" options; do
case "${options}" in
r)
repository=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
curl -s https://registry.hub.docker.com/v1/repositories/${repository}/tags | jq -r '.[].name'
save it as docker_tag
and make sure it is executable.
example: ./docker_tag -r portworx/px-dev
output:
....
....
....
2.3.6
2.4.0
2.4.1-rc1
2.5.0
2.5.0.1
2.5.0.2
2.5.0.3
2.5.1
2.5.1.2
2.5.1.3
2.5.2
2.5.2.1
2.5.3
dcos-1.8
dev