Distribution Registry: Difference between revisions
(→API) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
=Overview= | =Overview= | ||
A stateless server that allows you distribute container images and other content. | A stateless server that allows you distribute container images and other content. | ||
=In-Container Storage= | |||
<font size=-2> | |||
/var/lib/registry/docker/registry/v2/repositories | |||
</font> | |||
=Docker Registry Operations= | =Docker Registry Operations= | ||
Line 13: | Line 19: | ||
=API= | =API= | ||
{{External|https://distribution.github.io/distribution/spec/api/}} | {{External|https://distribution.github.io/distribution/spec/api/}} | ||
==Get the Catalog== | |||
Get the repository catalog, which is a list of repositories exposed by this registry: | |||
<syntaxhighlight lang='bash'> | |||
curl -X GET http://kind-registry.vsl:5000/v2/_catalog | |||
</syntaxhighlight> | |||
==Get the Tags for a Specific Repository== | |||
<syntaxhighlight lang='bash'> | |||
curl -X GET http://kind-registry.vsl:5000/v2/<repository-name>/tags/list | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='bash'> | |||
curl -X GET http://kind-registry.vsl:5000/v2/test-image/tags/list | |||
</syntaxhighlight> | |||
=Old Content (TO REFACTOR)= | =Old Content (TO REFACTOR)= |
Latest revision as of 19:33, 8 December 2023
External
- https://docs.docker.com/registry/
- https://distribution.github.io/distribution/
- https://distribution.github.io/distribution/spec/api/
Internal
Overview
A stateless server that allows you distribute container images and other content.
In-Container Storage
/var/lib/registry/docker/registry/v2/repositories
Docker Registry Operations
API
Get the Catalog
Get the repository catalog, which is a list of repositories exposed by this registry:
curl -X GET http://kind-registry.vsl:5000/v2/_catalog
Get the Tags for a Specific Repository
curl -X GET http://kind-registry.vsl:5000/v2/<repository-name>/tags/list
curl -X GET http://kind-registry.vsl:5000/v2/test-image/tags/list
Old Content (TO REFACTOR)
Docker caches images downloaded from remote repositories locally, in a local registry. This local registry is also referred to as Docker's local storage area, and it usually lives under /var/lib/docker. Depending on the storage driver in use, the local storage area is mounted under /var/lib/docker/devicemapper, /var/lib/docker/overlay, etc. The content of the local registry can be queried with docker images. Images can be removed from the local registry with docker rmi.
Docker Registry - Exposing the Content of the Local Image Registry over TCP
The content of the local image registry can be exposed over the network, in a conceptually similar manner to how Docker Hub is doing it. This is done by a "registry" container, whose image can be pulled from Docker Hub. According to Docker documentation, "the Registry is a stateless, highly scalable server side application that stores and lets you distribute Docker image."
Note that by default the Docker Registry container starts with HTTP support only, so all other Docker servers that use it must be configured to allow it as an "insecure registry", with --insecure-registry as described here.
By default, the registry data is persisted as a Docker volume on the local host filesystem, in a directory structure similar to the one shown below. The location can be customized as shown here.
# tree ./local-registry/
./local-registry/
└── docker
└── registry
└── v2
├── blobs
│ └── sha256
│ ├── 3f
│ │ └── 3fd9065eaf02feaf94d68376da52541925650b81698c53c6824d92ff63f98353
│ │ └── data
│ ├── 8c
│ │ └── 8c03bb07a531c53ad7d0f6e7041b64d81f99c6e493cb39abba56d956b40eacbc
│ │ └── data
│ └── ff
│ └── ff3a5c916c92643ff77519ffa742d3ec61b7f591b6b7504599d95a4a41134e28
│ └── data
└── repositories
└── test
├── _layers
│ └── sha256
│ ├── 3fd9065eaf02feaf94d68376da52541925650b81698c53c6824d92ff63f98353
│ │ └── link
│ └── ff3a5c916c92643ff77519ffa742d3ec61b7f591b6b7504599d95a4a41134e28
│ └── link
├── _manifests
│ ├── revisions
│ │ └── sha256
│ │ └── 8c03bb07a531c53ad7d0f6e7041b64d81f99c6e493cb39abba56d956b40eacbc
│ │ └── link
│ └── tags
│ └── latest
│ ├── current
│ │ └── link
│ └── index
│ └── sha256
│ └── 8c03bb07a531c53ad7d0f6e7041b64d81f99c6e493cb39abba56d956b40eacbc
│ └── link
└── _uploads
For details on how to operate the registry, see:
Docker Registry as a Pull-Through Cache