fix: add all directories as safe git directories inside the Docker image (#4034)
Some checks failed
Release a tag / release (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/Dockerfile]) (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/alpine.Dockerfile]) (push) Has been cancelled
Some checks failed
Release a tag / release (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/Dockerfile]) (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/alpine.Dockerfile]) (push) Has been cancelled
This commit is contained in:
parent
ac0627ddab
commit
411e0bbbd3
@ -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"]
|
||||
|
@ -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"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user