Dockerfile 468 B

123456789101112
  1. FROM golang:1.17 AS build
  2. WORKDIR /go/src/github.com/zricethezav/gitleaks
  3. COPY . .
  4. RUN VERSION=$(git describe --tags --abbrev=0) && \
  5. GO111MODULE=on CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="github.com/zricethezav/gitleaks/v8/cmd.Version=${VERSION}
  6. FROM alpine:3.14.2
  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. ENTRYPOINT ["gitleaks"]