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