787cbc
% CONTAINERS-REGISTRIES.CONF(5) System-wide registry configuration file
787cbc
% Brent Baude
787cbc
% Aug 2017
787cbc
787cbc
# NAME
787cbc
containers-registries.conf - Syntax of System Registry Configuration File
787cbc
787cbc
# DESCRIPTION
787cbc
The CONTAINERS-REGISTRIES configuration file is a system-wide configuration
787cbc
file for container image registries. The file format is TOML.
787cbc
787cbc
By default, the configuration file is located at `/etc/containers/registries.conf`.
787cbc
787cbc
# FORMATS
787cbc
787cbc
## VERSION 2
787cbc
VERSION 2 is the latest format of the `registries.conf` and is currently in
787cbc
beta. This means in general VERSION 1 should be used in production environments
787cbc
for now.
787cbc
787cbc
### GLOBAL SETTINGS
787cbc
787cbc
`unqualified-search-registries`
787cbc
: An array of _host_[`:`_port_] registries to try when pulling an unqualified image, in order.
787cbc
787cbc
### NAMESPACED `[[registry]]` SETTINGS
787cbc
787cbc
The bulk of the configuration is represented as an array of `[[registry]]`
787cbc
TOML tables; the settings may therefore differ among different registries
787cbc
as well as among different namespaces/repositories within a registry.
787cbc
787cbc
#### Choosing a `[[registry]]` TOML table
787cbc
787cbc
Given an image name, a single `[[registry]]` TOML table is chosen based on its `prefix` field.
787cbc
787cbc
`prefix`
787cbc
: A prefix of the user-specified image name, i.e. using one of the following formats:
787cbc
    - _host_[`:`_port_]
787cbc
    - _host_[`:`_port_]`/`_namespace_[`/`_namespace_…]
787cbc
    - _host_[`:`_port_]`/`_namespace_[`/`_namespace_…]`/`_repo_
787cbc
    - _host_[`:`_port_]`/`_namespace_[`/`_namespace_…]`/`_repo_(`:`_tag|`@`_digest_)
787cbc
787cbc
    The user-specified image name must start with the specified `prefix` (and continue
787cbc
    with the appropriate separator) for a particular `[[registry]]` TOML table to be
787cbc
    considered; (only) the TOML table with the longest match is used.
787cbc
787cbc
    As a special case, the `prefix` field can be missing; if so, it defaults to the value
787cbc
    of the `location` field (described below).
787cbc
787cbc
#### Per-namespace settings
787cbc
787cbc
`insecure`
787cbc
: `true` or `false`.
787cbc
    By default, container runtimes require TLS when retrieving images from a registry.
787cbc
    If `insecure` is set to `true`, unencrypted HTTP as well as TLS connections with untrusted
787cbc
    certificates are allowed.
787cbc
787cbc
`blocked`
787cbc
: `true` or `false`.
787cbc
    If `true`, pulling images with matching names is forbidden.
787cbc
787cbc
#### Remapping and mirroring registries
787cbc
787cbc
The user-specified image reference is, primarily, a "logical" image name, always used for naming
787cbc
the image.  By default, the image reference also directly specifies the registry and repository
787cbc
to use, but the following options can be used to redirect the underlying accesses
787cbc
to different registry servers or locations (e.g. to support configurations with no access to the
787cbc
internet without having to change `Dockerfile`s, or to add redundancy).
787cbc
787cbc
`location`
787cbc
: Accepts the same format as the `prefix` field, and specifies the physical location
787cbc
    of the `prefix`-rooted namespace.
787cbc
787cbc
    By default, this equal to `prefix` (in which case `prefix` can be omitted and the
787cbc
    `[[registry]]` TOML table can only specify `location`).
787cbc
787cbc
    Example: Given
787cbc
    ```
787cbc
    prefix = "example.com/foo"
787cbc
    location = "internal-registry-for-example.net/bar"
787cbc
    ```
787cbc
    requests for the image `example.com/foo/myimage:latest` will actually work with the
787cbc
    `internal-registry-for-example.net/bar/myimage:latest` image.
787cbc
787cbc
`mirror`
787cbc
: An array of TOML tables specifying (possibly-partial) mirrors for the
787cbc
    `prefix`-rooted namespace.
787cbc
787cbc
    The mirrors are attempted in the specified order; the first one that can be
787cbc
    contacted and contains the image will be used (and if none of the mirrors contains the image,
787cbc
    the primary location specified by the `registry.location` field, or using the unmodified
787cbc
    user-specified reference, is tried last).
787cbc
787cbc
    Each TOML table in the `mirror` array can contain the following fields, with the same semantics
787cbc
    as if specified in the `[[registry]]` TOML table directly:
787cbc
    - `location`
787cbc
    - `insecure`
787cbc
787cbc
`mirror-by-digest-only`
787cbc
: `true` or `false`.
787cbc
    If `true`, mirrors will only be used during pulling if the image reference includes a digest.
787cbc
    Referencing an image by digest ensures that the same is always used
787cbc
    (whereas referencing an image by a tag may cause different registries to return
787cbc
    different images if the tag mapping is out of sync).
787cbc
787cbc
    Note that if this is `true`, images referenced by a tag will only use the primary
787cbc
    registry, failing if that registry is not accessible.
787cbc
787cbc
*Note*: Redirection and mirrors are currently processed only when reading images, not when pushing
787cbc
to a registry; that may change in the future.
787cbc
787cbc
### EXAMPLE
787cbc
787cbc
```
787cbc
unqualified-search-registries = ["example.com"]
787cbc
787cbc
[[registry]]
787cbc
prefix = "example.com/foo"
787cbc
insecure = false
787cbc
blocked = false
787cbc
location = "internal-registry-for-example.com/bar"
787cbc
787cbc
[[registry.mirror]]
787cbc
location = "example-mirror-0.local/mirror-for-foo"
787cbc
787cbc
[[registry.mirror]]
787cbc
location = "example-mirror-1.local/mirrors/foo"
787cbc
insecure = true
787cbc
```
787cbc
Given the above, a pull of `example.com/foo/image:latest` will try:
787cbc
    1. `example-mirror-0.local/mirror-for-foo/image:latest`
787cbc
    2. `example-mirror-1.local/mirrors/foo/image:latest`
787cbc
    3. `internal-registry-for-example.net/bar/myimage:latest`
787cbc
787cbc
in order, and use the first one that exists.
787cbc
787cbc
## VERSION 1
787cbc
VERSION 1 can be used as alternative to the VERSION 2, but it does not support
787cbc
using registry mirrors, longest-prefix matches, or location rewriting.
787cbc
787cbc
The TOML format is used to build a simple list of registries under three
787cbc
categories: `registries.search`, `registries.insecure`, and `registries.block`.
787cbc
You can list multiple registries using a comma separated list.
787cbc
787cbc
Search registries are used when the caller of a container runtime does not fully specify the
787cbc
container image that they want to execute.  These registries are prepended onto the front
787cbc
of the specified container image until the named image is found at a registry.
787cbc
787cbc
Note that insecure registries can be used for any registry, not just the registries listed
787cbc
under search.
787cbc
787cbc
The `registries.insecure` and `registries.block` lists have the same meaning as the
787cbc
`insecure` and `blocked` fields in VERSION 2.
787cbc
787cbc
### EXAMPLE
787cbc
The following example configuration defines two searchable registries, one
787cbc
insecure registry, and two blocked registries.
787cbc
787cbc
```
787cbc
[registries.search]
787cbc
registries = ['registry1.com', 'registry2.com']
787cbc
787cbc
[registries.insecure]
787cbc
registries = ['registry3.com']
787cbc
787cbc
[registries.block]
787cbc
registries = ['registry.untrusted.com', 'registry.unsafe.com']
787cbc
```
787cbc
787cbc
# HISTORY
787cbc
Mar 2019, Added additional configuration format by Sascha Grunert <sgrunert@suse.com>
787cbc
787cbc
Aug 2018, Renamed to containers-registries.conf(5) by Valentin Rothberg <vrothberg@suse.com>
787cbc
787cbc
Jun 2018, Updated by Tom Sweeney <tsweeney@redhat.com>
787cbc
787cbc
Aug 2017, Originally compiled by Brent Baude <bbaude@redhat.com>