Promote Artifacts with Skopeo Copy
TOC
Feature OverviewUse CasesPrerequisitesPromotion FlowSteps1. Prepare Registry Credentials2. Create the Promotion Pipeline3. Start a Promotion RunAlternative: Promote One Image to Multiple DestinationsOperation ResultsTroubleshootingLearn MoreFeature Overview
Artifact promotion moves already-built artifacts from one trusted location to
another, such as from a development image repository to a staging or production
repository. For container images, use the skopeo-copy Task to copy images
without rebuilding them.
When the promotion requires human review, place a manual approval step before
skopeo-copy. The approval step pauses the PipelineRun until the required
approvers approve the promotion, and the copy step starts only after approval
succeeds.
Use Cases
- Promote images from development, test, or staging repositories to production.
- Promote several related images in one auditable promotion run.
- Require a release manager or release group to approve production promotion.
- Keep build pipelines and promotion pipelines separate, so production artifacts are copied from immutable build outputs instead of rebuilt.
Prerequisites
Tekton Pipelinesis installed.- The
skopeo-copyTaskis available from the configured Hub catalog. Manual Approval Gateis deployed for the approval workflow shown in this guide. For approval setup and operation details, see Manual Approval Gate.- Source and destination registry credentials are prepared as Kubernetes
Secretobjects in the namespace where thePipelineRunruns. - The pipeline author can create or update
Pipelineresources, and the run user can createPipelineRunresources in the target namespace. - You understand basic
Pipeline,PipelineRun,Task, andWorkspaceconcepts. If needed, review Pipeline, PipelineRun, Task, and Workspace.
Promotion Flow
A typical image promotion pipeline contains two stages:
wait-for-approval: requires designated approvers to approve the promotion.promote-images: copies one or more images withskopeo-copy.
Keep the approval policy in the Pipeline definition. Do not expose approval
policy parameters such as approvers, numberOfApprovalsRequired, or approval
rules as PipelineRun parameters. If those values are exposed at run time, a
pipeline executor could override the default approval rule and bypass the
intended release control.
The PipelineRun should only provide values that legitimately change per run,
such as the source and destination image mappings.
Steps
1. Prepare Registry Credentials
Create one secret for the source registry and another for the destination
registry. The following examples use kubernetes.io/dockerconfigjson secrets:
If the same credential can access both registries, you can bind the same secret to both workspaces.
2. Create the Promotion Pipeline
The following pipeline fixes the approval policy in the Pipeline and exposes
only imageMappings, srcTLSVerify, and dstTLSVerify as run-time inputs.
Replace release-manager and group:release-approvers with the canonical user
and group identifiers from your identity provider. For identifier details, see
User and group identifiers.
The imageMappings parameter accepts one SRC DST mapping per array item. Each
image reference must include the skopeo transport prefix, such as docker://.
When imageMappings is not empty, skopeo-copy uses it for batch promotion and
ignores srcImage and dstImages.
3. Start a Promotion Run
Create a PipelineRun and provide the images that need to be promoted. For
multiple images, put every source-to-destination pair in imageMappings:
Set timeouts.pipeline and timeouts.tasks long enough for the expected
approval window. The approval task timeout should be shorter than the
PipelineRun timeout. In this example, the approval task can wait up to 24h,
while the whole PipelineRun can run for up to 72h.
Alternative: Promote One Image to Multiple Destinations
If you are promoting one source image to one or more target tags, you can also
use srcImage and dstImages instead of imageMappings:
Use this form only when one source image needs one or more destination tags. Use
imageMappings when a promotion run contains multiple source images.
Operation Results
- The
PipelineRunstops atwait-for-approvaluntil the required approver or group approves it. - If the approval is rejected, the
PipelineRunfails and the promotion copy does not start. - If the approval succeeds,
skopeo-copycopies each mapping to the destination registry. skopeo-copyemits digest-oriented results for successful registry destinations, includingIMAGES,dst-IMAGE_URL,dst-IMAGE_DIGEST,dst-image-urls, anddst-image-tag.
Use the following commands to inspect the run:
For approval audit details, inspect status.approversResponse on the generated
ApprovalTask.
Troubleshooting
- Promotion starts without the expected gate: Confirm the
skopeo-copytask hasrunAfter: [wait-for-approval]or otherwise depends on the approval task. - A run user can change approvers: Remove approval policy values from
PipelineRunparameters and keep them in a protectedPipelinedefinition. - Approval task never appears: Confirm
Manual Approval Gateis installed and ready, then inspect theCustomRunandApprovalTaskresources. - Registry authentication fails: Verify that the source and destination
secrets contain credentials for the registries used in
imageMappings. - TLS verification fails for an internal registry: Prefer mounting the
correct CA bundle. Set
srcTLSVerifyordstTLSVerifyto"false"only for a trusted internal registry that intentionally uses insecure access or self-signed certificates. - Only some mappings were copied: Inspect the
promote-imagesTaskRunlogs. EachimageMappingsitem must contain exactly two references:SRC DST.