Dockerfile 459 B

12345678910111213
  1. FROM golang:1.21 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.19
  7. RUN apk add --no-cache bash git openssh-client
  8. COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
  9. RUN git config --global --add safe.directory '*'
  10. ENTRYPOINT ["gitleaks"]