Skip to content

Commit

Permalink
fix: add all directories as a safe git directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Aug 21, 2023
1 parent 8e7bb3e commit 202dd59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +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 /app as safe
RUN git config --global --add safe.directory /app
# Set all directory 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"]
4 changes: 2 additions & 2 deletions build/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +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 /app as safe
RUN git config --global --add safe.directory /app
# Set all directory 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 202dd59

Please sign in to comment.