Parcourir la source

small docker image size

just 8.55MB
hetykai il y a 6 ans
Parent
commit
ac5ec5371c
1 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 5 5
      Dockerfile

+ 5 - 5
Dockerfile

@@ -1,9 +1,9 @@
-FROM golang:alpine
+FROM golang:alpine AS builder
 
-RUN apk update && apk add git
+RUN apk add --no-cache git && CGO_ENABLED=0 GOOS=linux go get github.com/alash3al/httpsify
 
-RUN go get github.com/alash3al/httpsify
+FROM scratch
 
-ENTRYPOINT ["httpsify"]
+COPY --from=builder /go/bin/httpsify /go/bin/httpsify
 
-WORKDIR /root/
+ENTRYPOINT ["/go/bin/httpsify"]