We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aba2be8 commit faa59b8Copy full SHA for faa59b8
1 file changed
Dockerfile
@@ -1,11 +1,13 @@
1
-FROM golang:1.18-alpine AS build_base
+FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS build_base
2
RUN apk add --no-cache git gcc ca-certificates libc-dev
3
WORKDIR /build
4
COPY go.mod go.sum ./
5
RUN go mod download
6
COPY ./ ./
7
+
8
ENV CGO_ENABLED=0
-RUN go build -ldflags "-w -s" -trimpath -o speedtest .
9
+ARG TARGETOS TARGETARCH
10
+RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -trimpath -buildvcs=false -o speedtest .
11
12
FROM scratch
13
WORKDIR /app
0 commit comments