Skip to content

NINEJKH/docker-certbot-dns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-certbot-dns

build and publish Docker Pulls

A docker image providing certbot (0.24) + all official DNS plugins. This is ideal if you want to create letsencrypt wildcard certificates.

Pull

$ docker pull 9jkh/certbot-dns

Example usage

  1. Create IAM user with the following policy: sample-aws-policy.json
  2. See possible boto3 environment variables
  3. See possible dns plugins

Prepare

$ mkdir -p "$(pwd)/letsencrypt"
$ docker pull 9jkh/certbot-dns

Generate wildcard certificate over Route53

$ docker run \
  -e "AWS_ACCESS_KEY_ID=abc123" \
  -e "AWS_SECRET_ACCESS_KEY=123abc" \
  --name "certbot-dns" \
  --volume "$(pwd)/letsencrypt:/etc/letsencrypt" \
  9jkh/certbot-dns \
  certonly \
  --server "https://acme-staging-v02.api.letsencrypt.org/directory" \
  --dns-route53 \
  --agree-tos \
  -m "[email protected]" \
  --non-interactive \
  -d "*.yourdomain.com"

Distribute (optional)

Optionally you could programmatically store the cert on S3 for other apps to easiliy retrieve:

$ (cd "$(pwd)/letsencrypt/live/yourdomain.com" && zip -q -r - .) > yourdomain.com.zip
$ aws s3 cp yourdomain.com.zip s3://certs/yourdomain.zip