Caddy built with DNS, cache, Trojan and S3 certificate-storage plugins.
946
Caddy compiled from source with a fixed plugin set, published to Docker Hub as
two image flavours: a scratch image that carries only the binary, and an
Alpine image that runs as a container. CI tracks upstream Caddy releases, so a
new Caddy version is built within a day of its release.
| Plugin | Build flag | Provides |
|---|---|---|
| huaweicloud | WITH_HUAWEICLOUD=true | Huawei Cloud DNS provider |
| cloudflare | WITH_CLOUDFLARE=true | Cloudflare DNS provider |
| dnspod | WITH_DNSPOD=true | DNSPod DNS provider |
| alidns | WITH_ALIDNS=true | Alibaba Cloud DNS provider |
| cache | WITH_CACHE=true | Server-side HTTP cache (cache-handler) |
| s3-storage | WITH_S3_STORAGE=true | S3-compatible certificate storage (certmagic-s3) |
| trojan | WITH_TROJAN=true | Trojan proxy protocol |
v{version} is the upstream Caddy version, for example v2.11.9.
| Variant | Plugins | Descriptive tag | Short alias |
|---|---|---|---|
default | huaweicloud, cache, s3-storage | v{version}-huaweicloud-cache-s3 | v{version}-default |
full | all seven | v{version}-huaweicloud-cloudflare-dnspod-alidns-cache-s3-trojan | v{version}-full |
Each tag exists twice: the binary image uses the tag as listed, the runtime
image appends -alpine. The descriptive tag and the short alias point at the
same image, so both naming schemes stay valid.
latest and latest-alpine are only moved when a manual run passes
update_latest: true, so a scheduled build cannot silently change what
latest points at.
Both variants are multi-arch: linux/amd64 and linux/arm64.
The binary image is a scratch image. Extract the binary from it:
docker create --name caddy-extract oaklight/caddy:v2.11.9-huaweicloud-cache-s3
docker cp caddy-extract:/caddy ./caddy
docker rm caddy-extract
docker run -d \
--name caddy \
-p 80:80 -p 443:443 -p 443:443/udp \
-v /path/to/Caddyfile:/etc/caddy/Caddyfile \
-v caddy_data:/var/lib/caddy \
oaklight/caddy:v2.11.9-huaweicloud-cache-s3-alpine
{
cache {
ttl 1h
stale 24h
default_cache_control public, max-age=3600
}
}
example.com {
cache
reverse_proxy localhost:8080
}
Any S3-compatible backend works: AWS S3, MinIO, Oracle Cloud Object Storage. Several Caddy instances can share one bucket. The plugin takes a distributed lock, so only one instance issues a given certificate.
{
storage s3 {
endpoint "https://<endpoint>"
bucket "caddy-certs"
region "<region>"
access_key "<access-key>"
secret_key "<secret-key>"
prefix "caddy"
encryption_key "<32-byte-key>"
use_path_style true
}
}
Set use_path_style true for custom endpoints. The plugin comes from
techknowlogick/certmagic-s3.
.github/workflows/build.yml runs daily, on manual dispatch and on changes to
the build files. It does this:
linux/amd64 and linux/arm64 and pushes.caddy version reports the expected upstream version.caddy list-modules --packages contains every expected plugin.caddy validate.:8080.Manual run with a pinned version and no push:
gh workflow run build.yml -f caddy_version=2.11.9 -f push=false
gh workflow run build.yml -f caddy_version=2.11.9 -f update_latest=true
Required repository secrets: DOCKERHUB_USERNAME and DOCKERHUB_TOKEN.
make build # default variant, latest Caddy
make build VARIANT=full CADDY_VERSION=2.11.9
make version # print the resolved image tag
caddy-dns/dnspod tagged releases (through v0.0.4) still depend on
libdns v0.2 and do not compile against libdns v1, which Caddy 2.11
requires. The build pins the commit that migrated to libdns v1 until a new
tag is published. Override it when that changes:
docker build --build-arg DNSPOD_VERSION=v0.1.0 --build-arg WITH_DNSPOD=true .
Verified locally with Caddy 2.11.9: the default and full variants build,
report the expected version, load every expected plugin, validate a config and
serve a request.
LIBDNS_HUAWEICLOUD_FORK replaces github.com/libdns/huaweicloud at build
time with xcaddy --replace. Use it to test an upstream fix before it is
merged.
docker build --target runtime \
--build-arg WITH_HUAWEICLOUD=true \
--build-arg LIBDNS_HUAWEICLOUD_FORK=github.com/<owner>/<repo>@<commit> \
-t caddy:test .
Content type
Image
Digest
sha256:66334b243…
Size
25.2 MB
Last updated
2 days ago
docker pull oaklight/caddy:v2.11.9-full-alpine