Sfoglia il codice sorgente

Merge pull request #51 from petermbenjamin/update-dockerfile

Update Dockerfile
Zachary Rice 8 anni fa
parent
commit
17efe94f95
1 ha cambiato i file con 5 aggiunte e 18 eliminazioni
  1. 5 18
      Dockerfile

+ 5 - 18
Dockerfile

@@ -1,24 +1,11 @@
 FROM golang:1.10.0 AS build
-
-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
+WORKDIR /go/src/github.com/zricethezav/gitleaks
+COPY . .
+RUN CGO_ENABLED=0 go build -o bin/gitleaks *.go
 
 FROM alpine:3.7
-
-ENV PROJECT /go/src/github.com/zricethezav/gitleaks
-
-WORKDIR /app
-
-RUN apk update && apk upgrade && apk add --no-cache bash git openssh
-
-COPY --from=build $PROJECT/bin/* /usr/bin/
-
+RUN apk add --no-cache bash git openssh
+COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
 ENTRYPOINT ["gitleaks"]
 
 # How to use me :