feat: enable multi-platform builds in Dockerfile

Signed-off-by: Noste <83548733+Noooste@users.noreply.github.com>
This commit is contained in:
Noste
2025-12-21 23:48:03 +01:00
parent 61dae6c605
commit 31b3aca8f9
+6 -3
View File
@@ -1,4 +1,4 @@
FROM node:25-alpine3.22 AS frontend-builder
FROM --platform=$BUILDPLATFORM node:25-alpine3.22 AS frontend-builder
WORKDIR /app/frontend
@@ -11,7 +11,10 @@ COPY frontend/ .
RUN npm run build
FROM golang:1.25.4-alpine3.22 AS backend-builder
FROM --platform=$BUILDPLATFORM golang:1.25.4-alpine3.22 AS backend-builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app
@@ -31,7 +34,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o garage-ui .
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -installsuffix cgo -o garage-ui .
FROM alpine:3.22