lego/Dockerfile
Pall Valmundsson 1d9b0906b1 Update Dockerfile (#484)
This updates the Dockerfile to use multi-stage builds and enables a build argument to specify which version or SHA is built.
2018-05-30 14:01:23 +02:00

16 lines
442 B
Docker

FROM golang:alpine3.7 as builder
ARG LEGO_VERSION=master
RUN apk update && \
apk add --no-cache --virtual git && \
go get -u github.com/xenolf/lego && \
cd ${GOPATH}/src/github.com/xenolf/lego && \
git checkout ${LEGO_VERSION} && \
go build -o /usr/bin/lego .
FROM alpine:3.7
RUN apk update && apk add --no-cache --virtual ca-certificates
COPY --from=builder /usr/bin/lego /usr/bin/lego
ENTRYPOINT [ "/usr/bin/lego" ]