-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump alpine and add default safe dir for git * comment out safe dir fix * update deps
- Loading branch information
1 parent
a42b32b
commit 82f7d61
Showing
3 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
FROM golang:1.17 AS build | ||
FROM golang:1.18 AS build | ||
WORKDIR /go/src/github.com/zricethezav/gitleaks | ||
COPY . . | ||
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} | ||
|
||
FROM alpine:3.14.2 | ||
FROM alpine:3.15.4 | ||
RUN adduser -D gitleaks && \ | ||
apk add --no-cache bash git openssh-client | ||
COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/ | ||
USER gitleaks | ||
|
||
# default to avoid the follow error: | ||
# 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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters