Fix manifest list creation for multi-arch Docker images
- Remove existing manifests before creating new ones - Add architecture annotations for proper platform detection - Ensures Docker pulls correct architecture automatically - Matches fix applied to generic-docker-images
This commit is contained in:
@@ -58,14 +58,24 @@ jobs:
|
||||
- name: Create and push manifest list
|
||||
run: |
|
||||
# Only create manifest on main branch
|
||||
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
|
||||
# Create the manifest list using the architecture-specific digests
|
||||
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
|
||||
# Remove any existing manifest to ensure we create a fresh one
|
||||
docker manifest rm gitea.jde.nz/public/simple-object-server:latest 2>/dev/null || true
|
||||
|
||||
# Create the manifest list using the architecture-specific images
|
||||
docker manifest create gitea.jde.nz/public/simple-object-server:latest \
|
||||
--amend gitea.jde.nz/public/simple-object-server:latest-x86_64 \
|
||||
--amend gitea.jde.nz/public/simple-object-server:latest-aarch64
|
||||
|
||||
|
||||
# Annotate the manifests with the correct architecture
|
||||
docker manifest annotate gitea.jde.nz/public/simple-object-server:latest \
|
||||
gitea.jde.nz/public/simple-object-server:latest-x86_64 --arch amd64
|
||||
|
||||
docker manifest annotate gitea.jde.nz/public/simple-object-server:latest \
|
||||
gitea.jde.nz/public/simple-object-server:latest-aarch64 --arch arm64
|
||||
|
||||
# Push the manifest list
|
||||
docker manifest push gitea.jde.nz/public/simple-object-server:latest
|
||||
|
||||
|
||||
echo "Manifest list created and pushed successfully"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user