To get a docker image's tags using the docker hub api:
curl -sL https://hub.docker.com/v2/repositories/<org>/<name>/tags
I pipe that into | jq
and extract what I need.
However some images don't have an organization, e.g. mariadb.
I tried all these:
curl -sL https://hub.docker.com/v2/repositories/mariadb/tags
curl -sL https://hub.docker.com/v2/repositories/_/mariadb/tags
curl -sL https://hub.docker.com/v2/repositories/mariadb/_/tags
curl -sL https://hub.docker.com/v2/repositories/mariadb/mariadb/tags
But those give errors, or this:
{"count":0,"next":null,"previous":null,"results":[]}
How can I do this?