Registries

The container registries the runtime environments are pushed to

  1. In this section
  2. How it works
  3. Turning a registry off
  4. Credentials in use
  5. Who manages registries
  6. The config seed
  7. In a git repository
  8. The REST API

For administrators: name the container registries the Designer’s runtime environments are pushed to and pulled from, from 7.9.0.


In this section

Page What it covers
The registries page The list of registries, its columns, and the dialog that adds one
A registry’s page A registry’s tabs, the runtime environments that name it, Test connection and Delete

How it works

From 7.9.0 a registry is a connection of its own, added under Connections > Registries, right below Repositories. It has these fields:

Field What it is
Name The name a runtime environment’s registry gives to be pushed to it, such as ghcr
Description What it is for, optional
Address The registry’s host, with its port and path if any: ghcr.io/myorg, registry.example.com:5000
TLS check On by default: the registry’s certificate is checked. Off for a registry with a self-signed certificate
Credential Optional: a credential of Connections > Credentials, of type Container registry. None for a public registry
Enabled On by default. Turned off, nothing is built to it nor pulled from it, see Turning a registry off

A registry is always reached over https. An address typed with https:// is kept without it, and any other scheme, http:// included, is refused. With TLS check off, a builder pushes the image and signs it without checking the registry’s certificate, and Test connection does not check it either.

A Container registry credential is a login only: a user and its password or token, without an address. The registry holds the address, so one login can serve several registries of the same service. A registry holds no secret of its own.

A runtime environment names its registry by its name, with the image’s path in it and its tag:

runner_rte:
  - name: rte-netapp
    registry:
      name: ghcr               # a registry of Connections > Registries
      path: af/rte-netapp      # the image's path in it, its name when left out
      tag: app                 # the app's release, or a tag of your own

A build pushes the image to the registry’s address with its credential’s login, and sends its TLS check to the builder. A job of a form that names that runtime environment (executionEnvironment) pulls the image from the same registry, with the same login.


Turning a registry off

A registry turned off is kept as it is, but nothing uses it until it is turned on again.

Turn it off with Disable in its row menu, at once, or with the Enabled switch at the end of its Details tab, written by Save. While it is off, a build of a runtime environment that names it, a job whose image is pulled from it and its Test connection are refused, each saying The registry '<name>' is disabled. Another registry is never taken in its place.


Credentials in use

A credential a registry signs in with is in use, as one a database connects with.

It cannot be deleted or renamed while a registry names it, and the Used by tab of its page lists the registries (see Credentials in use). Deleting a registry leaves its credential as it is.

A registry itself cannot be deleted while a runtime environment names it: the refusal names each one. Name another registry there first.


Who manages registries

The registries follow the role options of the other connections.

The list, a registry’s page and its API need the showSettings or the showConnectionsSettings role option. A Container registry credential is an admin’s to change and to name, as a runner’s (see Who may change a credential): only an admin can make a registry sign in with one, or change the address of a registry that names one, since its login would then go to that address. Another user may save a registry again with the credential it already names.

A registry declared in the config seed is read only on its page: change it in the seed file instead.


The config seed

A seed declares its registries in a registries: section, applied after the credentials they name.

Each item has a name and a url, and optionally a description, a credential of type registry, tls_verify (on unless said) and enabled (false turns it off). The credential can come from the credentials section of the same seed or be one made in the app:

credentials:
  items:
    - name: ghcr-login
      credential_type: registry   # a user and its password or token, no address
      user: af-bot
      password: ${SEED_GHCR_TOKEN}

registries:
  items:
    - name: ghcr                  # the name a runtime environment's registry gives
      description: The team's images
      url: ghcr.io/myorg
      credential: ghcr-login      # a credential of type registry; none for a public registry
    - name: lab
      url: registry.lab.example.com:5000
      tls_verify: false           # a self-signed certificate

See the full example and Managed objects for how the seed owns what it declares.


In a git repository

A repository with the Registries usage (use_for_registries) holds the registries, as the other connections it may hold.

Each entry of a controller_registries: list, in any YAML file of that repository, is an item of the seed’s registries: section. An entry whose credential is not there yet waits, and is read again when the credentials are next pulled. An entry still named by a runtime environment cannot be removed. See Configuration in git.


The REST API

Scripts manage the registries through the REST API, under /api/v2/registry, with the same role options as the page.

Call What it does
GET /api/v2/registry Lists the registries, each with how many runtime environments name it (used_by_count)
GET /api/v2/registry?name=<name> Gets the registry of that name
GET /api/v2/registry/<id> Gets one registry, with the runtime environments that name it (used_by)
POST /api/v2/registry Adds a registry: its name and url, and optionally description, credential, tls_verify and enabled
PUT /api/v2/registry/<id> Changes a registry
DELETE /api/v2/registry/<id> Deletes a registry, refused while a runtime environment names it; its credential stays
POST /api/v2/registry/<id>/check Tests it: signs in to its v2 API with its credential’s login
curl -X POST https://forms.example.com/api/v2/registry \
  -H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
  -d '{ "name": "ghcr", "url": "ghcr.io/myorg", "credential": "ghcr-login" }'

An address that is not valid, or a credential that does not exist or is not of type registry, is refused with 400.