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