diff --git a/build/Dockerfile b/build/Dockerfile index a8560c9d..3c86cb6f 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -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"] diff --git a/build/alpine.Dockerfile b/build/alpine.Dockerfile index f66e5aee..35f2626b 100644 --- a/build/alpine.Dockerfile +++ b/build/alpine.Dockerfile @@ -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"]