45fa0f8
% CONTAINERS-REGISTRIES.D(5) Registries.d Man Page
45fa0f8
% Miloslav Trmač
45fa0f8
% August 2016
45fa0f8
45fa0f8
# NAME
45fa0f8
containers-registries.d - Directory for various registries configurations
45fa0f8
45fa0f8
# DESCRIPTION
45fa0f8
45fa0f8
The registries configuration directory contains configuration for various registries
45fa0f8
(servers storing remote container images), and for content stored in them,
45fa0f8
so that the configuration does not have to be provided in command-line options over and over for every command,
45fa0f8
and so that it can be shared by all users of containers/image.
45fa0f8
45fa0f8
By default (unless overridden at compile-time), the registries configuration directory is `/etc/containers/registries.d`;
45fa0f8
applications may allow using a different directory instead.
45fa0f8
45fa0f8
## Directory Structure
45fa0f8
45fa0f8
The directory may contain any number of files with the extension `.yaml`,
45fa0f8
each using the YAML format.  Other than the mandatory extension, names of the files
45fa0f8
don’t matter.
45fa0f8
45fa0f8
The contents of these files are merged together; to have a well-defined and easy to understand
45fa0f8
behavior, there can be only one configuration section describing a single namespace within a registry
45fa0f8
(in particular there can be at most one one `default-docker` section across all files,
45fa0f8
and there can be at most one instance of any key under the the `docker` section;
45fa0f8
these sections are documented later).
45fa0f8
45fa0f8
Thus, it is forbidden to have two conflicting configurations for a single registry or scope,
45fa0f8
and it is also forbidden to split a configuration for a single registry or scope across
45fa0f8
more than one file (even if they are not semantically in conflict).
45fa0f8
45fa0f8
## Registries, Scopes and Search Order
45fa0f8
45fa0f8
Each YAML file must contain a “YAML mapping” (key-value pairs).  Two top-level keys are defined:
45fa0f8
45fa0f8
- `default-docker` is the _configuration section_ (as documented below)
45fa0f8
   for registries implementing "Docker Registry HTTP API V2".
45fa0f8
45fa0f8
   This key is optional.
45fa0f8
45fa0f8
- `docker` is a mapping, using individual registries implementing "Docker Registry HTTP API V2",
45fa0f8
   or namespaces and individual images within these registries, as keys;
45fa0f8
   the value assigned to any such key is a _configuration section_.
45fa0f8
45fa0f8
   This key is optional.
45fa0f8
45fa0f8
   Scopes matching individual images are named Docker references *in the fully expanded form*, either
45fa0f8
   using a tag or digest. For example, `docker.io/library/busybox:latest` (*not* `busybox:latest`).
45fa0f8
45fa0f8
   More general scopes are prefixes of individual-image scopes, and specify a repository (by omitting the tag or digest),
45fa0f8
   a repository namespace, or a registry host (and a port if it differs from the default).
45fa0f8
45fa0f8
   Note that if a registry is accessed using a hostname+port configuration, the port-less hostname
45fa0f8
   is _not_ used as parent scope.
45fa0f8
45fa0f8
When searching for a configuration to apply for an individual container image, only
45fa0f8
the configuration for the most-precisely matching scope is used; configuration using
45fa0f8
more general scopes is ignored.  For example, if _any_ configuration exists for
45fa0f8
`docker.io/library/busybox`, the configuration for `docker.io` is ignored
45fa0f8
(even if some element of the configuration is defined for `docker.io` and not for `docker.io/library/busybox`).
45fa0f8
45fa0f8
## Individual Configuration Sections
45fa0f8
45fa0f8
A single configuration section is selected for a container image using the process
45fa0f8
described above.  The configuration section is a YAML mapping, with the following keys:
45fa0f8
45fa0f8
- `sigstore-staging` defines an URL of of the signature storage, used for editing it (adding or deleting signatures).
45fa0f8
45fa0f8
   This key is optional; if it is missing, `sigstore` below is used.
45fa0f8
45fa0f8
- `sigstore` defines an URL of the signature storage.
45fa0f8
   This URL is used for reading existing signatures,
45fa0f8
   and if `sigstore-staging` does not exist, also for adding or removing them.
45fa0f8
45fa0f8
   This key is optional; if it is missing, no signature storage is defined (no signatures
45fa0f8
   are download along with images, adding new signatures is possible only if `sigstore-staging` is defined).
45fa0f8
45fa0f8
## Examples
45fa0f8
45fa0f8
### Using Containers from Various Origins
45fa0f8
45fa0f8
The following demonstrates how to to consume and run images from various registries and namespaces:
45fa0f8
45fa0f8
```yaml
45fa0f8
docker:
45fa0f8
    registry.database-supplier.com:
45fa0f8
        sigstore: https://sigstore.database-supplier.com
45fa0f8
    distribution.great-middleware.org:
45fa0f8
        sigstore: https://security-team.great-middleware.org/sigstore
45fa0f8
    docker.io/web-framework:
45fa0f8
        sigstore: https://sigstore.web-framework.io:8080
45fa0f8
```
45fa0f8
45fa0f8
### Developing and Signing Containers, Staging Signatures
45fa0f8
45fa0f8
For developers in `example.com`:
45fa0f8
45fa0f8
- Consume most container images using the public servers also used by clients.
45fa0f8
- Use a separate sigure storage for an container images in a namespace corresponding to the developers' department, with a staging storage used before publishing signatures.
45fa0f8
- Craft an individual exception for a single branch a specific developer is working on locally.
45fa0f8
45fa0f8
```yaml
45fa0f8
docker:
45fa0f8
    registry.example.com:
45fa0f8
        sigstore: https://registry-sigstore.example.com
45fa0f8
    registry.example.com/mydepartment:
45fa0f8
        sigstore: https://sigstore.mydepartment.example.com
45fa0f8
        sigstore-staging: file:///mnt/mydepartment/sigstore-staging
45fa0f8
    registry.example.com/mydepartment/myproject:mybranch:
45fa0f8
        sigstore: http://localhost:4242/sigstore
45fa0f8
        sigstore-staging: file:///home/useraccount/webroot/sigstore
45fa0f8
```
45fa0f8
45fa0f8
### A Global Default
45fa0f8
45fa0f8
If a company publishes its products using a different domain, and different registry hostname for each of them, it is still possible to use a single signature storage server
45fa0f8
without listing each domain individually. This is expected to rarely happen, usually only for staging new signatures.
45fa0f8
45fa0f8
```yaml
45fa0f8
default-docker:
45fa0f8
    sigstore-staging: file:///mnt/company/common-sigstore-staging
45fa0f8
```
45fa0f8
45fa0f8
# AUTHORS
45fa0f8
45fa0f8
Miloslav Trmač <mitr@redhat.com>