mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
reduce docker image size
This commit is contained in:
1 parent
2186f22999
commit
c4738ef26f
1 file changed
+14
-7
+14
-7
@@ -1,17 +1,24 @@
|
||||
FROM golang:1.10.0-alpine3.7
|
||||
FROM golang:1.10.0 AS build
|
||||
|
||||
WORKDIR /app
|
||||
ENV PROJECT /go/src/github.com/zricethezav/gitleaks
|
||||
|
||||
RUN mkdir -p $PROJECT
|
||||
|
||||
WORKDIR ${PROJECT}
|
||||
|
||||
RUN git clone https://github.com/zricethezav/gitleaks.git . \
|
||||
&& CGO_ENABLED=0 go build -o bin/gitleaks *.go
|
||||
|
||||
FROM alpine:3.7
|
||||
|
||||
ENV PROJECT /go/src/github.com/zricethezav/gitleaks
|
||||
|
||||
RUN apk update && apk upgrade && apk add --no-cache bash git openssh
|
||||
|
||||
COPY . ./
|
||||
|
||||
RUN go get -u github.com/zricethezav/gitleaks
|
||||
RUN go build
|
||||
COPY --from=build $PROJECT/bin/* /usr/bin/
|
||||
|
||||
ENTRYPOINT ["gitleaks"]
|
||||
|
||||
|
||||
# How to use me :
|
||||
|
||||
# docker build -t gitleaks .
|
||||
|
||||
Reference in new issue
Block a user