Bundling acmetool with a libcloud DNS challenge hook. See the list of supported DNS providers.
mkdir -p /my/acme/conf
wget -O /my/acme/conf/responses https://raw.githubusercontent.com/hlandau/acme/master/_doc/response-file.yaml
# Edit /my/acme/conf/responses file according to your needs
cat <<EOF > /my/acme/desired/my.example.com-desire
satisfy:
names:
- my.example.com
request:
key:
type: rsa|ecdsa
rsa-size: 2048
ecdsa-curve: nistp256
ocsp-must-staple: true
# Use staging for testing. Replace provider with:
# https://acme-staging.api.letsencrypt.org/directory
provider: https://acme-v01.api.letsencrypt.org/directory
challenge:
dns-01:
provider: vultr
key: 781472cf1d657a9bf46b61dee83c4
EOF
# Make sure you lower the file permission of this file
# because it contains sensitive information.
The libcloud hook needs to know the DNS provider and a provider specific configuration like username, access token, hostname, ... . This information must be stored in the desired file under the section 'challenge'. For the provider configuration please consult the provider specific documentation.
E.g. PowerDNS setup:
request:
challenge:
dns-01:
# 'Provider Constant' from https://libcloud.readthedocs.io/en/latest/dns/supported_providers.html#supported-providers
provider: powerdns
# Provider specific configuration
key: mykey
host: powerdns4.example.com
port: 8081
api_version: v1
docker run --rm -v /my/acme:/var/lib/acme cyon/acmetool-libcloud:latest
docker run --rm -v /my/acme:/var/lib/acme cyon/acmetool-libcloud:latest -- --xlog.severity=debug
The live folder always contains all the certificates, chains and keys. A reissue of the certificate will update the certificate and chain files.
$ tree /my/acme/live/my.example.com
> live/my.example.com
> ├── cert
> ├── chain
> ├── fullchain
> ├── privkey -> ../../keys/s4cy32o8kaucxkb37k9kajkq7atof8x0/privkey
> └── url
>
> 0 directories, 5 files
If you want to share the certificates and keys between containers it's best to create a named Data Volume Container. The volume destination inside the container is '/var/lib/acme'.
docker create --name acmetool cyon/acmetool-libcloud:latest echo "Data-only container for acmetool with libcloud hook"
# Run once to create all the acmetool state folders
docker run --rm --volumes-from acmetool cyon/acmetool-libcloud:latest
docker cp responses acmetool:/var/lib/acme/conf/
docker cp my.example.com-desire acmetool:/var/lib/acme/desired/
docker run --rm --volumes-from acmetool cyon/acmetool-libcloud:latest
docker run --volumes-from acmetool:ro --name nginx-with-acme-certs -d nginx