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