Skip to content

Commit 5fd4a6c

Browse files
svallerue2b-bot[bot]
authored andcommitted
ci(publish): build dashboard-api for arm64 too
GitOrigin-RevId: 5c565710330aa627465e4e7fc727c40d8104b720
1 parent 96d405a commit 5fd4a6c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/dashboard-api/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
ARG GOLANG_VERSION=1.26.8
22
ARG ALPINE_VERSION=3.24
33

4-
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS builder
4+
# The builder runs on the build platform and cross-compiles for the target
5+
# (TARGETARCH -> GOARCH), so an arm64 image is not a QEMU-emulated Go build.
6+
FROM --platform=$BUILDPLATFORM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS builder
7+
ARG TARGETARCH
58

69
RUN apk add --no-cache make
710

@@ -45,7 +48,7 @@ WORKDIR /build/dashboard-api
4548
ARG COMMIT_SHA
4649
ARG VERSION
4750
ARG EXPECTED_MIGRATION_TIMESTAMP
48-
RUN --mount=type=cache,target=/root/.cache/go-build make build COMMIT_SHA=${COMMIT_SHA} VERSION=${VERSION} EXPECTED_MIGRATION_TIMESTAMP=${EXPECTED_MIGRATION_TIMESTAMP}
51+
RUN --mount=type=cache,target=/root/.cache/go-build GOARCH=${TARGETARCH} make build COMMIT_SHA=${COMMIT_SHA} VERSION=${VERSION} EXPECTED_MIGRATION_TIMESTAMP=${EXPECTED_MIGRATION_TIMESTAMP}
4952
RUN chmod +x /build/dashboard-api/bin/dashboard-api
5053

5154
FROM alpine:${ALPINE_VERSION}

0 commit comments

Comments
 (0)