Repository navigation
Publishing to registries
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.
GHCR publishing is on by default:
ghcr:
upload: trueImages 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.
Publishing to another registry takes two steps.
In your repository, go to Settings → Secrets and variables → Actions and create the secrets your registry needs
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.ioIn 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.
Works for Docker Hub, Quay, Harbor, Artifactory and most other registries.
auth:
- method: basic
config:
username: secrets.REGISTRY_USERNAME
password: secrets.REGISTRY_PASSWORDUse 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.
List as many names as needed:
images:
- directory: "my-rock-name/0.1-24.04"
registries:
- docker.io
- my-ecr-publicEach registry gets its own upload job, and they run independently: a failure to push to one does not cancel the others.
The full list of registry options can be found in the CI configuration reference.