From f07e7e1eed3e7b1e760a0578485b3e011d4386aa Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 26 Sep 2023 12:28:21 +0200 Subject: [PATCH] Dockerfile: build gotestsum and goversioninfo without cgo It's not needed to build these binaries. The Dockerfile.dev image already has CGO_ENABLED=0 as default in the golang image, so does not need updates. Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 28dcc3e993e9..34ab160b1bd2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,13 +40,13 @@ FROM build-base-${BASE_VARIANT} AS goversioninfo ARG GOVERSIONINFO_VERSION RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg/mod \ - GOBIN=/out GO111MODULE=on go install "github.com/josephspurrier/goversioninfo/cmd/goversioninfo@${GOVERSIONINFO_VERSION}" + GOBIN=/out GO111MODULE=on CGO_ENABLED=0 go install "github.com/josephspurrier/goversioninfo/cmd/goversioninfo@${GOVERSIONINFO_VERSION}" FROM build-base-${BASE_VARIANT} AS gotestsum ARG GOTESTSUM_VERSION RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg/mod \ - GOBIN=/out GO111MODULE=on go install "gotest.tools/gotestsum@${GOTESTSUM_VERSION}" \ + GOBIN=/out GO111MODULE=on CGO_ENABLED=0 go install "gotest.tools/gotestsum@${GOTESTSUM_VERSION}" \ && /out/gotestsum --version FROM build-${BASE_VARIANT} AS build