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