Is it possible to list, or search, private Docker repositories on the online version of Docker Hub, from command line, if you've logged in with an access token? I assume curl commands won't work because you can't log in to the web interface with an access token (and this has been my experience trying various curl commands on Docker), can you use the web API somehow?
I have tried various curl and API based solutions (e.g. How to get a list of images on docker registry v2) but they're mostly geared at private registries, not private repos on Docker Hub
This requires custom tooling just for Docker Hub, which exists as the experimental hub-tool. It's not built into other tools because the repository listing API in registries isn't limited to a user or organization. And the API that queries for all repositories is disabled on most SaaS registries because of scaling, privacy, and security reasons. With
hub-tool
, the command for that looks like:This is a lot easier. It's available from registry APIs, and Hub specific APIs. With
hub-tool
, that's:(In each of these, I'm using json formatting assuming you want to script the output.)
Other tools work on any registry, including Google's crane, RedHat's skopeo, and my own regclient.
Each of these has different ways to login with your PAT.
With curl, you need to login to get a token using your username and PAT there. This is all Hub specific, so I'd recommend using one of the above tools instead of curl for portability to other registries: