build: remove unused tools from being installed (#12671)

This commit is contained in:
R.B. Boyer 2022-04-05 16:01:02 -05:00 committed by GitHub
parent 12523197f9
commit 67bedd02cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 18 deletions

View File

@ -5,8 +5,6 @@ SHELL = bash
GOTOOLS = \
github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs@master \
github.com/hashicorp/go-bindata/go-bindata@master \
golang.org/x/tools/cmd/cover@master \
golang.org/x/tools/cmd/stringer@master \
github.com/vektra/mockery/cmd/mockery@master \
github.com/golangci/golangci-lint/cmd/golangci-lint@v1.40.1 \
github.com/hashicorp/lint-consul-retry@master

View File

@ -1,21 +1,7 @@
ARG GOLANG_VERSION=1.17.5
FROM golang:${GOLANG_VERSION}
ARG GOTOOLS="github.com/elazarl/go-bindata-assetfs/... \
github.com/hashicorp/go-bindata/... \
golang.org/x/tools/cmd/cover \
golang.org/x/tools/cmd/stringer \
github.com/axw/gocov/gocov \
gopkg.in/matm/v1/gocov-html"
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
RUN go install github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs@master
RUN go install github.com/hashicorp/go-bindata/go-bindata@master
WORKDIR /consul