Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit 8a104e2

Browse files
sapientpantsclaude
andauthored
fix: use docker buildx imagetools for multi-platform OCI archives (#316)
Replaced skopeo with docker buildx imagetools for importing and pushing multi-platform Docker images from OCI archives. The imagetools command is specifically designed to handle OCI manifest lists. Changes: - Removed skopeo installation step - Replaced skopeo copy commands with docker buildx imagetools import - Use imagetools create for additional tag aliases This fixes the error: "more than one image in oci, choose an image" The buildx imagetools approach: 1. docker buildx imagetools import imports the OCI archive and pushes it 2. docker buildx imagetools create creates tag aliases from existing tags 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent cede635 commit 8a104e2

File tree

2 files changed

+21
-30
lines changed

2 files changed

+21
-30
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'sonarqube-mcp-server': patch
3+
---
4+
5+
Fix multi-platform Docker image publishing using buildx imagetools
6+
7+
- Replace skopeo with docker buildx imagetools for OCI archive handling
8+
- The imagetools command properly imports multi-platform manifest lists from OCI archives
9+
- Fixes error: "more than one image in oci, choose an image"
10+
- Ensures both linux/amd64 and linux/arm64 images are pushed correctly to Docker Hub

.github/workflows/publish.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -357,53 +357,34 @@ jobs:
357357
username: ${{ secrets.DOCKERHUB_USERNAME }}
358358
password: ${{ secrets.DOCKERHUB_TOKEN }}
359359

360-
- name: Install skopeo
361-
# Skopeo is needed to handle OCI format images from multi-platform builds
362-
if: steps.check-docker.outputs.has_credentials == 'true'
363-
run: |
364-
sudo apt-get update
365-
sudo apt-get install -y skopeo
366-
367360
- name: Push Docker image
368-
# Push the pre-built OCI image directly to Docker Hub using skopeo
361+
# Push the pre-built OCI image directly to Docker Hub using buildx imagetools
369362
if: steps.check-docker.outputs.has_credentials == 'true'
370-
env:
371-
# Skopeo uses these environment variables for Docker Hub authentication
372-
REGISTRY_AUTH_FILE: /tmp/auth.json
373363
run: |
374-
echo "🔐 Configuring skopeo authentication..."
375-
# Create auth config for skopeo
376-
mkdir -p "$(dirname "$REGISTRY_AUTH_FILE")"
377-
echo "{\"auths\":{\"docker.io\":{\"auth\":\"$(echo -n \"${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }}\" | base64 -w0)\"}}}" > "$REGISTRY_AUTH_FILE"
378-
379364
echo "📥 Decompressing Docker image..."
380365
gunzip ./docker-artifact/${{ steps.artifact.outputs.artifact_name }}.tar.gz
381366
382367
TARGET_REPO="${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}"
383368
VERSION="${{ steps.version.outputs.version }}"
384369
385-
echo "📤 Pushing OCI image directly to Docker Hub..."
386-
# Use skopeo to push from OCI archive directly to Docker Hub
387-
# This preserves multi-platform manifest lists
388-
skopeo copy \
389-
--multi-arch all \
390-
oci-archive:./docker-artifact/${{ steps.artifact.outputs.artifact_name }}.tar \
391-
docker://$TARGET_REPO:$VERSION
370+
echo "📤 Importing and pushing OCI image to Docker Hub..."
371+
# Use docker buildx imagetools to import from OCI archive and push to Docker Hub
372+
# This properly handles multi-platform manifest lists
373+
docker buildx imagetools import \
374+
--tag $TARGET_REPO:$VERSION \
375+
./docker-artifact/${{ steps.artifact.outputs.artifact_name }}.tar
392376
393377
echo "🏷️ Creating additional tags..."
394-
# Also add latest, major, and major.minor tags
378+
# Also add latest, major, and major.minor tags by creating aliases
395379
MAJOR=$(echo "$VERSION" | cut -d. -f1)
396380
MINOR=$(echo "$VERSION" | cut -d. -f2)
397381
398-
skopeo copy --multi-arch all docker://$TARGET_REPO:$VERSION docker://$TARGET_REPO:latest
399-
skopeo copy --multi-arch all docker://$TARGET_REPO:$VERSION docker://$TARGET_REPO:$MAJOR
400-
skopeo copy --multi-arch all docker://$TARGET_REPO:$VERSION docker://$TARGET_REPO:$MAJOR.$MINOR
382+
docker buildx imagetools create --tag $TARGET_REPO:latest $TARGET_REPO:$VERSION
383+
docker buildx imagetools create --tag $TARGET_REPO:$MAJOR $TARGET_REPO:$VERSION
384+
docker buildx imagetools create --tag $TARGET_REPO:$MAJOR.$MINOR $TARGET_REPO:$VERSION
401385
402386
echo "✅ Docker image published successfully"
403387
404-
# Cleanup auth file
405-
rm -f $REGISTRY_AUTH_FILE
406-
407388
# =============================================================================
408389
# NOTIFICATION
409390
# Send status updates to team communication channels

0 commit comments

Comments
 (0)