mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
fix git unsafe directory (#883)
* fix git unsafe directory fixes https://github.com/zricethezav/gitleaks/issues/846 * Update Dockerfile Co-authored-by: x <>
This commit is contained in:
1 parent
82e409a434
commit
c3b7932544
1 file changed
+2
-11
+2
-11
@@ -4,21 +4,12 @@ COPY . .
|
|||||||
RUN VERSION=$(git describe --tags --abbrev=0) && \
|
RUN VERSION=$(git describe --tags --abbrev=0) && \
|
||||||
CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="github.com/zricethezav/gitleaks/v8/cmd.Version=${VERSION}
|
CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="github.com/zricethezav/gitleaks/v8/cmd.Version=${VERSION}
|
||||||
|
|
||||||
FROM alpine:3.15.4
|
FROM alpine:3.16
|
||||||
RUN adduser -D gitleaks && \
|
RUN adduser -D gitleaks && \
|
||||||
apk add --no-cache bash git openssh-client
|
apk add --no-cache bash git openssh-client
|
||||||
COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
|
COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
|
||||||
USER gitleaks
|
USER gitleaks
|
||||||
|
|
||||||
# default to avoid the follow error:
|
RUN git config --global --add safe.directory '*'
|
||||||
# 11:09PM ERR fatal: unsafe repository ('/path' is owned by someone else)
|
|
||||||
# 11:09PM ERR To add an exception for this directory, call:
|
|
||||||
# 11:09PM ERR
|
|
||||||
# 11:09PM ERR git config --global --add safe.directory /path
|
|
||||||
# This means that when you run gitleaks from docker you must mount to /path
|
|
||||||
# in order to avoid this error.
|
|
||||||
|
|
||||||
# TODO waiting to push this until I've thought a bit more about it
|
|
||||||
# RUN git config --global --add safe.directory /path
|
|
||||||
|
|
||||||
ENTRYPOINT ["gitleaks"]
|
ENTRYPOINT ["gitleaks"]
|
||||||
Reference in new issue
Block a user