Blame containers-registries.d.5.md

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