소스 검색

Merge pull request #11 from hetykai/patch-1

small docker image size
Mohammed Al Ashaal 6 년 전
부모
커밋
9937070735
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  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"]