Distribution Registry

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

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

Docker Registry Operations

API

https://distribution.github.io/distribution/spec/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)


https://docs.docker.com/registry/

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

https://docs.docker.com/registry

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 Operations

Docker Registry as a Pull-Through Cache

https://docs.docker.com/registry/recipes/mirror/