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