From 202dd591f5f956f4bce135fb2b7f25e5edcb1e0d Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 21 Aug 2023 12:17:38 +0200 Subject: [PATCH] fix: add all directories as a safe git directory --- build/Dockerfile | 4 ++-- build/alpine.Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index cecf834b1cad5..906313bf8c0ab 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -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"] diff --git a/build/alpine.Dockerfile b/build/alpine.Dockerfile index a115db8ae1cf7..79515d97af57c 100644 --- a/build/alpine.Dockerfile +++ b/build/alpine.Dockerfile @@ -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"]