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