mirror of
https://github.com/go-acme/lego.git
synced 2024-11-25 09:00:57 +02:00
1d9b0906b1
This updates the Dockerfile to use multi-stage builds and enables a build argument to specify which version or SHA is built.
17 lines
442 B
Docker
17 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" ]
|