build: cross-compile for the target arch so no QEMU is needed
Docker Build and Push / Run Tests (push) Successful in 5m21s
SonarQube Scan / SonarQube Trigger (push) Successful in 7m14s
Docker Build and Push / Build linux/arm64 image (push) Successful in 2m10s
Docker Build and Push / Build linux/amd64 image (push) Successful in 2m22s
Docker Build and Push / Create multi-architecture image (push) Successful in 32s

This commit is contained in:
2026-11-09 23:37:17 +07:00
parent 3f33b09b29
commit 8db9033dc3
+3 -2
View File
@@ -1,5 +1,6 @@
FROM golang:1.27.3-alpine AS go_builder
FROM --platform=$BUILDPLATFORM golang:1.27.3-alpine AS go_builder
ARG TARGETARCH
ARG VERSION=dev
ARG BUILD_DATE=unknown
ARG COMMIT=unknown
@@ -20,7 +21,7 @@ COPY . .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=linux \
CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -trimpath \
-ldflags="-w -s \
-X tunnel_pls/internal/version.Version=${VERSION} \