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