From 21e855d860865f1472b3fdcb64a916e92bc83a9f Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" <4903+rboyer@users.noreply.github.com> Date: Wed, 30 Jun 2021 11:36:02 -0500 Subject: [PATCH] build: ensure make go-build-image target builds tools in isolation (#10534) --- build-support/docker/Build-Go.dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build-support/docker/Build-Go.dockerfile b/build-support/docker/Build-Go.dockerfile index 565600a609..fa67e46716 100644 --- a/build-support/docker/Build-Go.dockerfile +++ b/build-support/docker/Build-Go.dockerfile @@ -8,6 +8,14 @@ ARG GOTOOLS="github.com/elazarl/go-bindata-assetfs/... \ github.com/axw/gocov/gocov \ gopkg.in/matm/v1/gocov-html" -RUN GO111MODULE=on go get -v ${GOTOOLS} && mkdir -p /consul +RUN mkdir -p .gotools && \ + cd .gotools && \ + for tool in ${GOTOOLS}; do \ + echo "=== TOOL: ${tool}" ; \ + rm -rf go.mod go.sum ; \ + go mod init consul-tools ; \ + go get -v "${tool}" ; \ + done && \ + rm -rf go.mod go.sum WORKDIR /consul