fix: set an explicit GOROOT in the Docker image for go-critic (#3106)

This commit is contained in:
Ludovic Fernandez 2022-08-21 14:07:08 +02:00 committed by GitHub
parent 63b2fe0048
commit 970b0a5bd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

1
.gitattributes vendored
View File

@ -1,2 +1 @@
go.sum linguist-generated
Dockerfile.* linguist-language=Dockerfile

View File

@ -37,7 +37,7 @@ jobs:
matrix:
target:
- Dockerfile: build/Dockerfile
- Dockerfile: build/Dockerfile.alpine
- Dockerfile: build/alpine.Dockerfile
steps:
- uses: actions/checkout@v3

View File

@ -11,6 +11,8 @@ RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$VERSION -X
# stage 2
FROM golang:1.19
# related to https://github.com/golangci/golangci-lint/issues/3107
ENV GOROOT /usr/local/go
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
COPY --from=builder /golangci/golangci-lint /usr/bin/
CMD ["golangci-lint"]

View File

@ -16,6 +16,8 @@ RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$VERSION -X
# stage 2
FROM golang:1.19-alpine
# related to https://github.com/golangci/golangci-lint/issues/3107
ENV GOROOT /usr/local/go
# gcc is required to support cgo;
# git and mercurial are needed most times for go get`, etc.
# See https://github.com/docker-library/golang/issues/80