Skip to content

Commit 644cb14

Browse files
committed
Fix(docker): explicitly set TARGETARCH for multi-arch builds
1 parent 545226a commit 644cb14

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM golang:1.24.4-alpine AS build
22
ARG VERSION="dev"
3+
ARG TARGETARCH
34

45
# Set the working directory
56
WORKDIR /build
@@ -13,7 +14,7 @@ RUN --mount=type=cache,target=/var/cache/apk \
1314
RUN --mount=type=cache,target=/go/pkg/mod \
1415
--mount=type=cache,target=/root/.cache/go-build \
1516
--mount=type=bind,target=. \
16-
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
17+
CGO_ENABLED=0 GOARCH=${TARGETARCH} go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
1718
-o /bin/flashduty-mcp-server cmd/flashduty-mcp-server/main.go
1819

1920
# Make a stage to run the app

0 commit comments

Comments
 (0)