Skip to content

Commit

Permalink
fix: set an explicit GOROOT in the Docker image for go-critic (golang…
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored and SeigeC committed Apr 4, 2023
1 parent 9b38fb9 commit 54d0c70
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitattributes
@@ -1,2 +1 @@
go.sum linguist-generated
Dockerfile.* linguist-language=Dockerfile
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
target:
- Dockerfile: build/Dockerfile
- Dockerfile: build/Dockerfile.alpine
- Dockerfile: build/alpine.Dockerfile
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 2 additions & 0 deletions build/Dockerfile
Expand Up @@ -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"]
2 changes: 2 additions & 0 deletions build/Dockerfile.alpine → build/alpine.Dockerfile
Expand Up @@ -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
Expand Down

0 comments on commit 54d0c70

Please sign in to comment.