Skip to main content

Mirrors an OCI image 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

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 repository to mirror.string
stageThe pipeline stage that the jobs belongs to.deploystring
tagsThe runners that this job depends on.[]array
targetThe destination repository to mirror.string