From 72ddd8f177cb5282e4e597e65aba6c56ee994051 Mon Sep 17 00:00:00 2001 From: casjay Date: Sun, 21 Jun 2026 09:45:23 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20go=20install:=20each=20mod?= =?UTF-8?q?ule=20must=20be=20installed=20separately=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit go install rejects multiple packages from different modules in a single invocation. Split all 11 go install calls into individual commands chained with &&. - Dockerfile: split single multi-package go install into 11 separate go install calls, one per module, chained with && Dockerfile --- Dockerfile | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1443903..328c5c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,18 +36,17 @@ FROM --platform=$BUILDPLATFORM golang:alpine AS go-tools ARG TARGETOS=linux ARG TARGETARCH ENV CGO_ENABLED=0 -RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install \ - golang.org/x/tools/cmd/goimports@latest \ - golang.org/x/tools/cmd/stringer@latest \ - golang.org/x/tools/gopls@latest \ - golang.org/x/vuln/cmd/govulncheck@latest \ - github.com/go-delve/delve/cmd/dlv@latest \ - github.com/google/gops@latest \ - golang.org/x/perf/cmd/benchstat@latest \ - github.com/google/wire/cmd/wire@latest \ - go.uber.org/mock/mockgen@latest \ - google.golang.org/protobuf/cmd/protoc-gen-go@latest \ - google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install golang.org/x/tools/cmd/goimports@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install golang.org/x/tools/cmd/stringer@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install golang.org/x/tools/gopls@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install golang.org/x/vuln/cmd/govulncheck@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install github.com/go-delve/delve/cmd/dlv@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install github.com/google/gops@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install golang.org/x/perf/cmd/benchstat@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install github.com/google/wire/cmd/wire@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install go.uber.org/mock/mockgen@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest FROM ${PULL_URL}:${DISTRO_VERSION} AS build ARG TZ