I am struggling to find consistent and informative API documentation for docker or docker hub for operations like listing tags, images, what are the parameters I can use similar to page_size and how can I order the result… etc?
The official docs for the enine is easy to find: https://docs.docker.com/engine/api/v1.40/ (swagger openapi docs).
Afaik Docker Hub’s api docs can not be found directly. You can find the docker registry’s api docs here, which at one point was, and I hope still is the registry und the hood.
You can find swagger api docs for commercial private on-prem Docker Trusted Registry, though the api is not the same as Docker Hub’s.
- Brief introduction
The daemon listens on unix:///var/run/docker.sock but you can Bind Docker to another host/port or a Unix socket.
The API tends to be REST. However, for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout, stdin and stderr.
A Content-Length header should be present in POST requests to endpoints that expect a body.
To lock to a specific version of the API, you prefix the URL with the version of the API to use. For example, /v1.18/info. If no version is included in the URL, the maximum supported API version is used.
If the API version specified in the URL is not supported by the daemon, a HTTP 400 Bad Request error message is returned.
The Engine API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
“message”: “page not found”