forked from TrueCloudLab/lego
1d9b0906b1
This updates the Dockerfile to use multi-stage builds and enables a build argument to specify which version or SHA is built.
16 lines
442 B
Docker
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" ]
|