Browse Source

dockerfile optimizations

dehydrated-hook-powerdns
will Farrell 8 years ago
parent
commit
ada1a22495
  1. 13
      Dockerfile
  2. 15
      README.md

13
Dockerfile

@ -1,8 +1,10 @@
# TODO python 3 not-supported lexicon#68
FROM library/python:2-alpine
FROM library/alpine:3.5
# deps - openssl curl sed grep mktemp
RUN apk --no-cache add bash openssl curl git \
# deps - python openssl curl sed grep mktemp
RUN apk add --no-cache --virtual .build-deps git \
&& apk add --no-cache --virtual .dehydrated-rundeps python py2-pip bash openssl curl \
&& pip install --upgrade pip \
&& pip install dns-lexicon dns-lexicon[route53] dns-lexicon[transip] \
&& cd /tmp \
&& git clone https://github.com/lukas2511/dehydrated.git --depth 1 \
&& chmod a+x dehydrated/dehydrated \
@ -11,8 +13,7 @@ RUN apk --no-cache add bash openssl curl git \
&& chmod a+x lexicon/examples/dehydrated.default.sh \
&& mv lexicon/examples/dehydrated.default.sh /usr/bin/dehydrated-dns \
&& rm -rf /tmp/* \
&& pip install dns-lexicon dns-lexicon[route53] dns-lexicon[transip] \
&& apk del git
&& apk del .build-deps
COPY config /etc/dehydrated/config

15
README.md

@ -8,7 +8,7 @@ container to generate letsencrypt certs using dehydrated + lexicon
[![](https://images.microbadger.com/badges/version/willfarrell/letsencrypt.svg)](http://microbadger.com/images/willfarrell/letsencrypt "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/willfarrell/letsencrypt.svg)](http://microbadger.com/images/willfarrell/letsencrypt "Get your own image badge on microbadger.com")
## Dockerfile
Use to set your own defaults
Use to set your own defaults or overwrite in the command
```Dockerfile
FROM willfarrell/letsencrypt:latest
@ -28,7 +28,6 @@ LEXICON_CLOUDFLARE_TOKEN=
## Testing
```bash
docker build -t letsencrypt .
docker rm -f letsencrypt
# private
docker run \
@ -36,19 +35,16 @@ docker run \
letsencrypt \
dehydrated \
--cron --domain letsencrypt.willfarrell.ca \
--out /etc/ssl \
--hook dehydrated-dns \
--challenge dns-01 \
--force
# public
docker run -d \
--volumes-from nginx_nginx_1 \
--env-file letsencrypt.env \
letsencrypt \
dehydrated \
--cron --domain letsencrypt.willfarrell.ca \
--out /etc/ssl \
--challenge http-01 \
--force
@ -57,12 +53,13 @@ docker exec -it nginx_nginx_1 /etc/scripts/make_hpkp && /etc/init.d/nginx reload
```
## Deploy
See https://github.com/willfarrell/docker-nginx for full example
```bash
# private
docker run \
--volumes-from nginx_nginx_1 \
--env-file letsencrypt.env \
letsencrypt \
willfarrell/letsencrypt \
dehydrated \
--cron --domain letsencrypt.willfarrell.ca \
--out /etc/ssl \
@ -73,14 +70,12 @@ docker run \
docker run -d \
--volumes-from nginx_nginx_1 \
--env-file letsencrypt.env \
letsencrypt \
willfarrell/letsencrypt \
dehydrated \
--cron --domain letsencrypt.willfarrell.ca \
--out /etc/ssl \
--challenge http-01
```
## TODO
- [ ] Update to python 3 (not-supported lexicon#68)
`certbot/make_letsencrypt_cert` is an alternate method that one could use with the certbot docker image. However dns-01 is not supported.
Note: `certbot/make_letsencrypt_cert` is an alternate method that one could use with the certbot docker image. However dns-01 is not supported.
Loading…
Cancel
Save