diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f0e43c62 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine:3.3 + +ENV GOPATH /go + +RUN apk update && apk add ca-certificates go git && \ + rm -rf /var/cache/apk/* + +COPY . /go/src/github.com/xenolf/lego + +RUN cd /go/src/github.com/xenolf/lego && \ + go get ./... && \ + go build -o /usr/bin/lego . && \ + apk del ca-certificates go git && \ + rm -rf /var/cache/apk/* && \ + rm -rf /go + +ENTRYPOINT [ "/usr/bin/lego" ] diff --git a/README.md b/README.md index a4c76b7b..ff692132 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,11 @@ To install from source, just run go get -u github.com/xenolf/lego ``` +To build lego inside a Docker container, just run +``` +docker build -t lego . +``` + #### Features - Register with CA