You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/dashboard-api/Dockerfile
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,10 @@
1
1
ARG GOLANG_VERSION=1.26.8
2
2
ARG ALPINE_VERSION=3.24
3
3
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
5
8
6
9
RUN apk add --no-cache make
7
10
@@ -45,7 +48,7 @@ WORKDIR /build/dashboard-api
45
48
ARG COMMIT_SHA
46
49
ARG VERSION
47
50
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}
49
52
RUN chmod +x /build/dashboard-api/bin/dashboard-api
0 commit comments