Skip to content

Publishing to registries

Anna Sancho Vaquer edited this page Oct 22, 2026 · 3 revisions

Rocks can be published to GHCR and to any number of additional registries. Publishing happens in the Upload stage of the CI pipeline, only for pushes to main and only after the build and tests succeed.

GitHub Container Registry (GHCR)

GHCR publishing is on by default:

ghcr:
  upload: true

Images are pushed to

ghcr.io/<owner>/<repository>/<rock-name>:<version>-<base>_edge

using the workflow's built-in GITHUB_TOKEN; you do not need to create a secret. The rock.yml workflow already grants the required packages: write permission.

Set upload: false to build and test without publishing. Disabling GHCR upload also disables the vulnerability scan, which scans the images published there.

Additional registries

Publishing to another registry takes two steps.

1. Store the credentials as secrets

In your repository, go to Settings → Secrets and variables → Actions and create the secrets your registry needs

2. Declare the registry and select it per image

Define the registry under registries and give it a name. Then, reference that name in the images that should be published to it:

registries:
  docker.io:
    uri: docker.io/ubuntu
    auth:
      - method: basic
        config:
          username: secrets.DOCKERHUB_USERNAME
          password: secrets.DOCKERHUB_TOKEN

images:
  - directory: "my-rock-name/0.1-24.04"
    registries:
      - docker.io

In this case, the image is then pushed to docker.io/ubuntu/my-rock-name:0.1-24.04_edge (in addition to GHCR, if enabled).

Important

Write only the names of secrets in ci.yaml, in the form secrets.<NAME>. Never write the credentials themselves.

A registry that is defined but not referenced by any image receives nothing.

Authentication methods

Basic (username and password)

Works for Docker Hub, Quay, Harbor, Artifactory and most other registries.

auth:
  - method: basic
    config:
      username: secrets.REGISTRY_USERNAME
      password: secrets.REGISTRY_PASSWORD

AWS ECR and ECR Public

Use ecr for private ECR registries and ecr-public for ECR Public. The CI exchanges your AWS credentials for a short-lived registry login token at upload time.

registries:
  my-ecr-public:
    uri: public.ecr.aws/my-alias
    auth:
      - method: ecr-public
        config:
          region: us-east-1
          username: secrets.AWS_ACCESS_KEY_ID
          password: secrets.AWS_SECRET_ACCESS_KEY
Parameter Value
region The AWS region as plain text (not a secret). ECR Public is served from us-east-1.
username Secret holding the AWS access key ID.
password Secret holding the AWS secret access key.

The IAM user needs permission to authenticate to and push to the repository.

Several registries per image

List as many names as needed:

images:
  - directory: "my-rock-name/0.1-24.04"
    registries:
      - docker.io
      - my-ecr-public

Each registry gets its own upload job, and they run independently: a failure to push to one does not cancel the others.

Registry reference

The full list of registry options can be found in the CI configuration reference.

Clone this wiki locally