4
0

Dockerfile 502 B

123456789101112131415
  1. FROM golang:1.19 AS build
  2. WORKDIR /go/src/github.com/zricethezav/gitleaks
  3. COPY . .
  4. RUN VERSION=$(git describe --tags --abbrev=0) && \
  5. CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="github.com/zricethezav/gitleaks/v8/cmd.Version=${VERSION}
  6. FROM alpine:3.16
  7. RUN adduser -D gitleaks && \
  8. apk add --no-cache bash git openssh-client
  9. COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
  10. USER gitleaks
  11. RUN git config --global --add safe.directory '*'
  12. ENTRYPOINT ["gitleaks"]