Skip to content

Commit eaeb66d

Browse files
committed
fix: use buildx imagetools for multi-arch manifest creation
docker manifest create cannot handle OCI image indexes produced by the docker-container buildx driver. Switch to docker buildx imagetools create which handles them natively. Extract manifest logic into reusable docker-manifest composite action.
1 parent b4b8c82 commit eaeb66d

File tree

2 files changed

+59
-23
lines changed

2 files changed

+59
-23
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 'Create Docker Multi-Arch Manifest'
16+
description: 'Combines per-arch images into multi-arch manifests with standard version tags'
17+
18+
inputs:
19+
image:
20+
description: 'Full image name without tag (e.g. ghcr.io/nvidia/eidos-validator)'
21+
required: true
22+
tag:
23+
description: 'Release tag (e.g. v0.5.11)'
24+
required: true
25+
26+
runs:
27+
using: 'composite'
28+
steps:
29+
- name: Setup Docker Buildx
30+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
31+
32+
- name: Create and push manifests
33+
shell: bash
34+
env:
35+
IMAGE: ${{ inputs.image }}
36+
TAG: ${{ inputs.tag }}
37+
run: |
38+
set -euo pipefail
39+
40+
# Extract major and minor versions (e.g., v0.5.11 -> v0, v0.5)
41+
MAJOR="v$(echo "$TAG" | sed 's/^v//' | cut -d. -f1)"
42+
MAJOR_MINOR="v$(echo "$TAG" | sed 's/^v//' | cut -d. -f1-2)"
43+
44+
for MANIFEST_TAG in "$TAG" "$MAJOR" "$MAJOR_MINOR" "latest"; do
45+
docker buildx imagetools create \
46+
-t "$IMAGE:$MANIFEST_TAG" \
47+
"$IMAGE:$TAG-amd64" \
48+
"$IMAGE:$TAG-arm64"
49+
echo "Pushed manifest: $IMAGE:$MANIFEST_TAG"
50+
done

.github/workflows/on-tag.yaml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -220,31 +220,17 @@ jobs:
220220
contents: read
221221
packages: write
222222
steps:
223-
- name: Authenticate to registry
224-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
225-
with:
226-
registry: ghcr.io
227-
username: ${{ github.actor }}
228-
password: ${{ github.token }}
223+
- name: Checkout Code
224+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
229225

230-
- name: Create and push manifests
231-
env:
232-
TAG: ${{ github.ref_name }}
233-
run: |
234-
set -euo pipefail
226+
- name: Authenticate to registry
227+
uses: ./.github/actions/ghcr-login
235228

236-
# Extract major and minor versions (e.g., v0.5.7 -> v0, v0.5)
237-
MAJOR="v$(echo "$TAG" | sed 's/^v//' | cut -d. -f1)"
238-
MAJOR_MINOR="v$(echo "$TAG" | sed 's/^v//' | cut -d. -f1-2)"
239-
240-
# Create and push manifest for each tag
241-
for MANIFEST_TAG in "$TAG" "$MAJOR" "$MAJOR_MINOR" "latest"; do
242-
docker manifest create --amend "$VALIDATOR_IMAGE:$MANIFEST_TAG" \
243-
"$VALIDATOR_IMAGE:$TAG-amd64" \
244-
"$VALIDATOR_IMAGE:$TAG-arm64"
245-
docker manifest push "$VALIDATOR_IMAGE:$MANIFEST_TAG"
246-
echo "Pushed manifest: $VALIDATOR_IMAGE:$MANIFEST_TAG"
247-
done
229+
- name: Create multi-arch manifest
230+
uses: ./.github/actions/docker-manifest
231+
with:
232+
image: ${{ env.VALIDATOR_IMAGE }}
233+
tag: ${{ github.ref_name }}
248234

249235
# =============================================================================
250236
# Publish: Flip draft release to public after all artifacts are ready

0 commit comments

Comments
 (0)