0

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?

1 Answer 1

1

I can't find official docs for this (can you?), but the trick is to use the magic string library:

curl -sL https://hub.docker.com/v2/repositories/library/mariadb/tags

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.