ORAS pull component
Download files from an OCI artifact and retain them as job artifacts, or copy the artifact to another registry without repackaging it.
Download files
Publish an artifact first, for example with oras-push. Give source its full
registry reference, including a tag or digest. Configure private registry access
using the registry authentication guide.
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@main
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/oras-pull@main
inputs:
source: registry.example.com/team/artifact:v1
target: downloads
The pull:oras job extracts the files into downloads/ and uploads that directory
as a GitLab job artifact retained for one week. Use a project-relative subdirectory; absolute paths,
checkout-root output and paths escaping the checkout are rejected. Prefix a
local path with ./ if it starts with oci:.
Copy to a registry
Prefix a registry target with oci:// to distinguish it from a directory:
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@main
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/oras-pull@main
inputs:
name: mirror
source: registry.example.com/team/artifact:v1
target: oci://registry.example.com/team/copy:v1
The copy:mirror job copies the OCI artifact to the destination reference using
ORAS copy. It does not upload a GitLab
file artifact. Configure credentials for both registries before running it.
References and paths may contain CI variables. The target's oci:// prefix must
be visible when GitLab evaluates job rules; do not generate it in a job script.
The copy includes the artifact's content graph, not unrelated referrer artifacts.
Use name to include this component more than once. stage defaults to build;
needs and tags default to empty arrays. target defaults to artifacts.
Source or destination failures fail the job.
Inputs
| Name | Description | Default | Type |
| --- | --- | --- | --- |
| name | Suffix for the pull or copy job name. | oras | string |
| needs | [] | array | |
| source | OCI artifact reference, with an optional oci:// prefix. | string | |
| stage | build | string | |
| tags | [] | array | |
| target | Project-relative output directory, or an oci:// registry reference. | artifacts | string |