diff --git a/Dockerfile b/Dockerfile index c0396407..511e403c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,15 @@ -FROM alpine:3.4 +FROM alpine:3.6 ENV GOPATH /go +ENV LEGO_VERSION tags/v0.4.1 -RUN apk update && apk add ca-certificates go git && \ - rm -rf /var/cache/apk/* && \ +RUN apk update && apk add --no-cache --virtual run-dependencies ca-certificates && \ + apk add --no-cache --virtual build-dependencies go git musl-dev && \ go get -u github.com/xenolf/lego && \ - cd /go/src/github.com/xenolf/lego && \ + cd ${GOPATH}/src/github.com/xenolf/lego && \ + git checkout ${LEGO_VERSION} && \ go build -o /usr/bin/lego . && \ - apk del go git && \ - rm -rf /var/cache/apk/* && \ - rm -rf /go + apk del build-dependencies && \ + rm -rf ${GOPATH} ENTRYPOINT [ "/usr/bin/lego" ]