Skip to content

Commit db46de9

Browse files
committed
remove crane usage
Signed-off-by: Mitchell <mitch_dz@hotmail.com>
1 parent 535a241 commit db46de9

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

.github/workflows/build_package_sources.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,26 +386,35 @@ jobs:
386386
owner_lower=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
387387
tag="ghcr.io/${owner_lower}/cuda-quantum-src:${tag_suffix}"
388388
tag_amd64="${tag}-amd64"
389+
tag_arm64="${tag}-arm64"
389390
docker tag package-sources:latest "$tag_amd64"
390391
docker push "$tag_amd64"
391392
echo "image_tag=$tag" | tee -a $GITHUB_OUTPUT
392393
echo "tag_amd64=$tag_amd64" | tee -a $GITHUB_OUTPUT
394+
echo "tag_arm64=$tag_arm64" | tee -a $GITHUB_OUTPUT
393395
394-
- name: Create arm64 manifest from amd64 (same contents)
396+
- name: Create arm64 image (copy /sources from amd64)
395397
run: |
396-
tag="${{ steps.push.outputs.image_tag }}"
397398
tag_amd64="${{ steps.push.outputs.tag_amd64 }}"
398-
tag_arm64="${tag}-arm64"
399-
docker run --rm \
400-
-v $HOME/.docker/config.json:/root/.docker/config.json:ro \
401-
gcr.io/go-containerregistry/crane:latest \
402-
copy --platform=linux/arm64 "$tag_amd64" "$tag_arm64"
399+
tag_arm64="${{ steps.push.outputs.tag_arm64 }}"
400+
base_image="${{ steps.base-image.outputs.base_image }}"
401+
# Extract /sources from amd64 image
402+
cid=$(docker create "$tag_amd64")
403+
docker cp "$cid:/sources" ./sources-from-amd64
404+
docker rm "$cid"
405+
# Build arm64 image: same base, add /sources
406+
cat > Dockerfile.arm64 << EOF
407+
FROM ${base_image}
408+
COPY sources-from-amd64 /sources
409+
EOF
410+
docker buildx build --platform linux/arm64 -f Dockerfile.arm64 -t "$tag_arm64" --load .
411+
docker push "$tag_arm64"
403412
404413
- name: Create and push multi-arch manifest
405414
run: |
406415
tag="${{ steps.push.outputs.image_tag }}"
407416
tag_amd64="${{ steps.push.outputs.tag_amd64 }}"
408-
tag_arm64="${tag}-arm64"
417+
tag_arm64="${{ steps.push.outputs.tag_arm64 }}"
409418
docker buildx imagetools create --tag "$tag" "$tag_amd64" "$tag_arm64" --push
410419
411420
- name: Summary

0 commit comments

Comments
 (0)