Skip to content

Commit

Permalink
fix: add all directories as safe git directories inside the Docker im…
Browse files Browse the repository at this point in the history
…age (#4034)
  • Loading branch information
ldez committed Aug 21, 2023
1 parent ac0627d commit 411e0bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/Dockerfile
Expand Up @@ -13,6 +13,8 @@ RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$VERSION -X
FROM golang:1.21
# related to https://github.com/golangci/golangci-lint/issues/3107
ENV GOROOT /usr/local/go
# Set all directories as safe
RUN git config --global --add safe.directory '*'
# 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/alpine.Dockerfile
Expand Up @@ -22,6 +22,8 @@ ENV GOROOT /usr/local/go
# git and mercurial are needed most times for go get`, etc.
# See https://github.com/docker-library/golang/issues/80
RUN apk --no-cache add gcc musl-dev git mercurial
# Set all directories as safe
RUN git config --global --add safe.directory '*'
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
COPY --from=builder /golangci/golangci-lint /usr/bin/
CMD ["golangci-lint"]

0 comments on commit 411e0bb

Please sign in to comment.