Skip to content

Docker Registry API v2

The Docker Registry HTTP API V2 is the protocol used by Docker engines and clients to interact with registry servers for storing and distributing images.^[600-developer__docker__Dockerfile__Dockerfile-01.md] A key characteristic of the V2 API is its use of a specific base path structure for all endpoints.^[600-developer__docker__Dockerfile__Dockerfile-01.md]

Base Path

All V2 API endpoints are prefixed with /v2/.^[600-developer__docker__Dockerfile__Dockerfile-01.md] For example, when interacting with a registry hosted locally on port 5000, the base URL would typically be http://127.0.0.1:5000/v2/.^[600-developer__docker__Dockerfile__Dockerfile-01.md]

Common Endpoints

Catalog

To retrieve a list of all repositories (images) stored in the registry, clients can query the _catalog endpoint^[600-developer__docker__Dockerfile__Dockerfile-01.md].

Request:

curl -X GET http://127.0.0.1:5000/v2/_catalog
Response:
{"repositories":["mytomcat"]}

Tags

To list available tags for a specific repository, the tags/list endpoint is used^[600-developer__docker__Dockerfile__Dockerfile-01.md].

Request:

curl -X GET http://127.0.0.1:5000/v2/mytomcat/tags/list
Response:
{"name":"mytomcat","tags":["latest"]}

Sources

^[600-developer__docker__Dockerfile__Dockerfile-01.md]