Skip to content

Commit b6e69ef

Browse files
committed
optimize building process for multi arch
1 parent f1f8617 commit b6e69ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# builder
2-
FROM golang:1.22 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.22 AS builder
33

44
WORKDIR /app
55
COPY go.mod go.sum ./
66
RUN go mod download
77
COPY . .
8-
RUN go build -o mongodb-index-advisor .
8+
ARG TARGETOS TARGETARCH
9+
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o mongodb-index-advisor .
910
RUN ls -lh /app/mongodb-index-advisor
1011

1112
# runner

0 commit comments

Comments
 (0)