Skip to content

Commit 0fc1cb3

Browse files
committed
ci(preview): build Docker previews for arm64 as well as amd64
The preview image was amd64-only while the release and stable images are built for linux/amd64,linux/arm64, so a preview tag could not stand in for socketdev/cli:latest on arm64 hosts without emulation. Match the release arch matrix and enable QEMU so the arm64 layer can be built on an amd64 runner. Previews are opt-in via label, so the extra build time is an acceptable tradeoff for making the tag a drop-in replacement.
1 parent 7270bde commit 0fc1cb3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/pr-preview.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ jobs:
254254
- name: Set up Docker publishing
255255
uses: ./.github/actions/setup-docker
256256
with:
257-
enable-qemu: "false"
257+
# QEMU is required to build the arm64 layer on an amd64 runner.
258+
enable-qemu: "true"
258259
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
259260
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
260261

@@ -268,7 +269,10 @@ jobs:
268269
file: Dockerfile.preview
269270
push: true
270271
pull: true
271-
platforms: linux/amd64
272+
# Match the arch matrix of the release and stable images so a preview is a
273+
# drop-in replacement for socketdev/cli:latest on arm64 runners too. The
274+
# arm64 layer builds under emulation, so expect roughly double the runtime.
275+
platforms: linux/amd64,linux/arm64
272276
tags: socketdev/cli:pr-${{ needs.context.outputs.pr_number }}
273277
build-args: |
274278
SDK_PREVIEW_VERSION=${{ inputs.sdk_preview_version }}

0 commit comments

Comments
 (0)