Let's discuss Docker Registry API and Docker Hub API and list the API endpoints related to searching and downloading the images. We will be using the command-line tool curl
, but you can use any REST client of your choice, even your web browser.
First, let's check the status of the remote registry, by issuing a call to /_ping
endpoint, by executing an HTTP GET:
curl -k https://registry.hub.docker.com/v1/_ping
The registry will reply with a simple true
value, that it's up and running.
First, we need to login or verify if we are logged in. Authorization is done with Basic Auth over SSL. To deal with user accounts, the API exposes the /users
endpoint. Now, issue a GET
on the following URL:
https://registry.hub.docker.com/v1/users
This will reply with an OK response if you are logged in or return the HTTP 401 Unauthorized
status if you are not:
The Docker Hub API is not read-only, it also accepts POST
requests. For example, you can register your new...