From 75606aeefde6f51b5f18d311d96874d9190f705f Mon Sep 17 00:00:00 2001 From: AKP <tom@tdpain.net> Date: Tue, 5 Apr 2022 20:55:09 +0100 Subject: [PATCH] Add `-buildvcs=false` to `go build` in Dockerfile See docker-library/golang#415 Signed-off-by: AKP <tom@tdpain.net> --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2072089..c35d87c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ -FROM golang:1-alpine as builder +FROM golang:1.18-alpine as builder RUN mkdir /build ADD . /build/ WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static" -s -w' -o main github.com/codemicro/walrss/walrss +# Go 1.18 introduced a compile-time dependency for Git unless `-buildvcs=false` is provided +RUN CGO_ENABLED=0 GOOS=linux go build -a -buildvcs=false -installsuffix cgo -ldflags '-extldflags "-static" -s -w' -o main github.com/codemicro/walrss/walrss FROM alpine COPY --from=builder /build/main /