A custom Docker image for the lego ACME client with added support for Docker secrets. Based on goacme/lego:v5.2.2.
Built on top of goacme/lego, this image adds:
_FILE is automatically expanded from its file contents at startup (via dzangolab/docker-secrets), enabling secure credential injection in Docker Swarm.Docker:
docker run \
-e CLOUDFLARE_DNS_API_TOKEN=your-token \
-v lego-data:/root/.lego \
dzangolab/lego \
--email [email protected] \
--dns cloudflare \
--domains example.com \
run
With Docker secrets (_FILE convention):
docker run \
-e CLOUDFLARE_DNS_API_TOKEN_FILE=/run/secrets/cf_token \
-v lego-data:/root/.lego \
dzangolab/lego \
--email [email protected] \
--dns cloudflare \
--domains example.com \
run
Docker Compose / Swarm:
services:
lego:
image: dzangolab/lego
command: >
--email [email protected]
--dns cloudflare
--domains example.com
renew
environment:
CLOUDFLARE_DNS_API_TOKEN_FILE: /run/secrets/cloudflare_dns_api_token
secrets:
- cloudflare_dns_api_token
volumes:
- lego-data:/root/.lego
secrets:
cloudflare_dns_api_token:
external: true
All environment variables supported by the upstream goacme/lego image are passed through unchanged. Additionally, any variable ending in _FILE will have its contents read from the specified file path and exported as the variable without the _FILE suffix. For example:
CLOUDFLARE_DNS_API_TOKEN_FILE → reads file, exports as CLOUDFLARE_DNS_API_TOKEN| ARG | Default | Description |
|---|---|---|
LEGO_VERSION | v5.2.2 | Upstream lego image tag |
DOCKER_SECRETS_VERSION | 1.1.2 | Version of dzangolab/docker-secrets to pull from |
Content type
Image
Digest
sha256:d10fa74f3…
Size
30.3 MB
Last updated
3 months ago
docker pull dzangolab/lego:5.2.2-1