Skip to main content

OCI Mirror component

Mirrors an OCI image or artifact from a source registry to a destination registry with skopeo copy.

Variables

NamerequiredtypeHints
CI_REGISTRY_USERrequiredstringGitLab container registry user. Provided by GitLab CI.
CI_REGISTRY_PASSWORDrequiredstringGitLab container registry password. Provided by GitLab CI.

Usage

Create GitLab pipeline file .gitlab-ci.yml:

include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/oci-mirror@stable
inputs:
source: registry.access.redhat.com/ubi10/ubi:latest
target: $CI_REGISTRY_IMAGE:ubi-latest

Mirror a Helm chart artifact by using normal registry references without the Helm oci:// prefix:

include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/oci-mirror@stable
inputs:
source: ghcr.io/jouve/charts/mailpit:0.34.1
target: $CI_REGISTRY_IMAGE/charts/mailpit:0.34.1

By default the mirror job runs only for tags. Override rules when the mirror should run for branches or merge requests.

Set remove-signatures: true when the destination registry cannot store source image signature attachments.

Inputs

NameDescriptionDefaultType
------------
nameocistring
needsThe jobs that this job depends on.[]array
remove-signaturesRemove source image signatures while copying. Enable this when the destination registry cannot store signature attachments.falseboolean
rulesThe rules that this job depends on.[{"if":"$CI_COMMIT_TAG","when":"always"},{"when":"never"}]array
sourceThe source OCI image or artifact reference to mirror.string
stageThe pipeline stage that the jobs belongs to.deploystring
tagsThe runners that this job depends on.[]array
targetThe destination OCI image or artifact reference to mirror to.string