We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9330327 + 6779f64 commit af51ba5Copy full SHA for af51ba5
1 file changed
Dockerfile
@@ -2,6 +2,9 @@
2
ARG GO_VERSION=1.22
3
FROM golang:${GO_VERSION}-alpine AS builder
4
5
+ARG TARGETOS
6
+ARG TARGETARCH
7
+
8
WORKDIR /app
9
10
# Copy Go modules and download dependencies first
@@ -15,7 +18,7 @@ COPY . .
15
18
# Build the static binary for the command-line tool
16
19
# CGO_ENABLED=0 produces a static binary, important for distroless/scratch images
17
20
# -ldflags="-s -w" strips debug symbols and DWARF info, reducing binary size
-RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o /openapi-mcp ./cmd/openapi-mcp/main.go
21
+RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-s -w" -o /openapi-mcp ./cmd/openapi-mcp/main.go
22
23
# --- Final Stage ---
24
# Use a minimal base image. distroless/static is very small and secure.
0 commit comments