Sign inSign up

dzangolab/lego

By dzangolab

Updated 3 months ago

Image
0

308

dzangolab/lego repository overview

lego

A custom Docker image for the lego ACME client with added support for Docker secrets. Based on goacme/lego:v5.2.2.

What this image adds

Built on top of goacme/lego, this image adds:

  • Docker secrets support — any environment variable ending in _FILE is automatically expanded from its file contents at startup (via dzangolab/docker-secrets), enabling secure credential injection in Docker Swarm.

Usage

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

Environment variables

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

Build arguments

ARGDefaultDescription
LEGO_VERSIONv5.2.2Upstream lego image tag
DOCKER_SECRETS_VERSION1.1.2Version of dzangolab/docker-secrets to pull from

Tag summary

Content type

Image

Digest

sha256:d10fa74f3

Size

30.3 MB

Last updated

3 months ago

docker pull dzangolab/lego:5.2.2-1