Use this action to copy a remote image from a source to a destination with Crane, a tool for managing container images. To copy Docker images with this action, you must have a Docker configuration file.
Automatic artifact data reporting
This action reports artifact-related data to the workflow run for artifact traceability purposes.
Do not include the CloudBees action: Register a build artifact for the same artifact version, as the resulting run would register duplicate artifact entries to CloudBees platform.
Prerequisites for copying a Docker image
Before invoking the action, you must have a Docker config file in the ${HOME}/.docker/config.json path. This file is used to authenticate with the Docker registry.
Use either of the following actions to generate a Docker config file:
-
The Open Container Initiative (OCI) credentials configuration action, for authenticating to an OCI registry.
-
The Amazon Elastic Container Registry (ECR) credentials configuration action, for authenticating to an ECR registry.
| If your source and destination registries are different, you must authenticate to both registries. Invoke the Docker registry authentication action separately for those registries before invoking the Crane action. |
| All CloudBees action repositories are listed at CloudBees, Inc. on GitHub. |
Inputs
| Input name | Data type | Required? | Description |
|---|---|---|---|
|
String |
Yes |
The destination image. |
|
String |
Yes |
The source image to copy. |
|
String |
No |
Specifies the platform in the format |
|
String |
No |
Default is |
Outputs
| Output name | Data type | Description |
|---|---|---|
|
String |
The unique identifier of the artifact reported to CloudBees platform. |
|
String |
Image digest of the destination image. |
|
String |
Image reference of the destination image, including the image digest. |
Usage examples
Basic example
The following is a basic example of using this action:
- name: Copy remote image with Crane id: copy-image uses: cloudbees-io/crane@v1 with: src: my-source-registry/source-image-name:source-tag-name destination: my-destination-registry/destination-image-name:destination-tag-name
Using optional inputs
The following example specifies optional inputs:
- name: Copy remote image with Crane id: copy-image uses: cloudbees-io/crane@v1 with: src: my-source-registry/source-image:source-tag destination: my-destination-registry/destination-image:destination-tag platform: linux/arm/v7 skip-image-validation: false
Using the action output
Access the output values in downstream steps using the outputs context.
In the following example, a Helm chart is copied using the Crane action, and output values are displayed.