This project:
- GitHub joweisberg/docker-certs-extraction
- Docker Hub joweisberg/certs-extraction
Generate certificates based on Traefik docker from json file to crt, key, pem, pfx and like Neilpang/acme.sh
A certs-extraction container is available. It includes the latest development HEAD version. You can use it to manage certificates.
- Generate certificates by Traefik
- Get a valid acme.json file
- Detect change every 3s on acme.json file based on Traefik
- Extract crt, key, pem, pfx files under certs/
- Copy certificates like acme.sh under acme/
- Duplicate acme certificates under
ACME_COPY
Example:
/var/docker/traefik
- acme.json
certs/
- ssl-cert.key
- ssl-cert.crt
- ssl-cert.pem
- ssl-cert.pfx
acme/
- ca.cer
- fullchain.cer
- sub.example.com.key
- sub.example.com.cer
TZ
: name of the TimeZone - ie. "Etc/UTC" or "Europe/Paris" (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)DOMAIN
: The domain name that you are updating - ie. sub.example.comACME_COPY
: the mounted volume to copy acme folder content. Use | separator for multiples folders (need to be mounted as volume on Docker)
Please follow the official documentation:
https://docs.docker.com/install/
The Docker image to use joweisberg/certs-extraction:latest
.
Build on Linux Ubuntu 20.04 LTS, Docker 19.03 and above for:
Platform | Architecture / Tags |
---|---|
x86_64 | amd64 |
aarch64 | arm64 |
arm | arm32 |
$ docker pull joweisberg/certs-extraction:latest
Run the container in console mode (notice the environment variable setting parameters for the startup command)
$ docker run -d --restart="unless-stopped" -e TZ="Europe/Paris" -e DOMAIN="sub.example.com" -v /var/docker/traefik:/mnt/data joweisberg/certs-extraction:latest
version: "3.5"
services:
certs-extraction:
container_name: certs-extraction
image: joweisberg/certs-extraction:latest
restart: unless-stopped
environment:
- TZ=Europe/Paris
- DOMAINS=sub1.example.com sub2.example.com
- ACME_COPY=/mnt/certs-to-copy
healthcheck:
test: ["CMD", "/usr/bin/healthcheck"]
interval: 30s
timeout: 10s
retries: 5
volumes:
- /var/docker/traefik:/mnt/data
- /mnt/certs-to-copy:/mnt/certs-to-copy