Skip to content

Commit 6c2090f

Browse files
committed
fix: use skopeo copy --all instead of crane
Match the approach used in docker-builds repo.
1 parent e375833 commit 6c2090f

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

.github/workflows/promote-docker-image.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,38 +82,32 @@ jobs:
8282
needs: [validate-inputs]
8383
runs-on: ubuntu-latest
8484
steps:
85-
- name: Install crane
86-
uses: imjasonh/setup-crane@v0.4
87-
88-
- name: Log in to Docker Hub
89-
env:
90-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
91-
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
92-
run: crane auth login index.docker.io -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_TOKEN"
93-
9485
- name: Copy image to production registry
9586
uses: actions/github-script@v8
9687
env:
9788
SOURCE_TAG: ${{ needs.validate-inputs.outputs.source-tag-safe }}
9889
TARGET_TAGS: ${{ needs.validate-inputs.outputs.target-tags-safe }}
9990
IMAGE_NAME: ${{ inputs.image-name }}
91+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
92+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
10093
with:
10194
script: |
10295
const { execSync } = require('child_process');
10396
const sourceTag = process.env.SOURCE_TAG;
10497
const targetTags = JSON.parse(process.env.TARGET_TAGS);
10598
const imageName = process.env.IMAGE_NAME;
106-
const source = `temporaliotest/${imageName}:${sourceTag}`;
99+
const source = `docker://temporaliotest/${imageName}:${sourceTag}`;
100+
const destCreds = `--dest-creds=${process.env.DOCKERHUB_USERNAME}:${process.env.DOCKERHUB_TOKEN}`;
107101
108102
core.info(`Promoting ${imageName} image...`);
109-
core.info(` From: ${source}`);
103+
core.info(` From: temporaliotest/${imageName}:${sourceTag}`);
110104
core.info(` To: ${targetTags.map(t => `temporalio/${imageName}:${t}`).join(', ')}`);
111105
112-
// Use crane copy to preserve the full manifest list (multi-arch) and all labels/annotations
106+
// Use skopeo copy --all to preserve the full manifest list (multi-arch) and all labels/annotations
113107
for (const targetTag of targetTags) {
114-
const target = `temporalio/${imageName}:${targetTag}`;
108+
const target = `docker://temporalio/${imageName}:${targetTag}`;
115109
core.info(`Copying ${source} -> ${target}`);
116-
execSync(`crane copy ${source} ${target}`, { stdio: 'inherit' });
110+
execSync(`docker run --rm -i quay.io/skopeo/stable copy ${destCreds} --all ${source} ${target}`, { stdio: 'inherit' });
117111
}
118112
119113
core.info(`✓ ${imageName} image promoted successfully to all tags`);

0 commit comments

Comments
 (0)