From aa100eb6842b341dd1af6787f8ec630042ce1e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Mon, 7 Aug 2023 17:55:17 +0200 Subject: [PATCH] docker: add BUILDFLAGS arg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: László Várady --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8b32f92..dc1d517 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20-alpine3.18@sha256:7839c9f01b5502d7cb5 ARG TARGETOS ARG TARGETARCH ARG TARGETPLATFORM +ARG BUILDFLAGS RUN apk -U add make @@ -20,7 +21,7 @@ RUN go mod download ADD . . # Build -RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH make build +RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH make $BUILDFLAGS build # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details