Merge pull request #196 from JoyceBabu/patch-1

Optimized Dockerfile for smaller image size
This commit is contained in:
xenolf 2016-04-19 10:18:03 +02:00
commit 562781dd19

View file

@ -3,15 +3,12 @@ FROM alpine:3.3
ENV GOPATH /go ENV GOPATH /go
RUN apk update && apk add ca-certificates go git && \ RUN apk update && apk add ca-certificates go git && \
rm -rf /var/cache/apk/* rm -rf /var/cache/apk/* && \
go get -u github.com/xenolf/lego && \
COPY . /go/src/github.com/xenolf/lego cd /go/src/github.com/xenolf/lego && \
go build -o /usr/bin/lego . && \
RUN cd /go/src/github.com/xenolf/lego && \ apk del ca-certificates go git && \
go get ./... && \ rm -rf /var/cache/apk/* && \
go build -o /usr/bin/lego . && \ rm -rf /go
apk del ca-certificates go git && \
rm -rf /var/cache/apk/* && \
rm -rf /go
ENTRYPOINT [ "/usr/bin/lego" ] ENTRYPOINT [ "/usr/bin/lego" ]