[GH-ISSUE #19] Request for cloudflare + cache-handler #9

Closed
opened 2026-02-27 19:08:49 +03:00 by kerem · 6 comments
Owner

Originally created by @nodesocket on GitHub (Jun 12, 2025).
Original GitHub issue: https://github.com/CaddyBuilds/caddy-cloudflare/issues/19

Thanks for created/hosting these pre-built images. Anyway to get acloudflare + caddyserver/cache-handler image? That would be amazing.

Originally created by @nodesocket on GitHub (Jun 12, 2025). Original GitHub issue: https://github.com/CaddyBuilds/caddy-cloudflare/issues/19 Thanks for created/hosting these pre-built images. Anyway to get a`cloudflare` + `caddyserver/cache-handler` image? That would be amazing.
kerem closed this issue 2026-02-27 19:08:49 +03:00
Author
Owner

@vkartk commented on GitHub (Jun 18, 2025):

Hey, @nodesocket thanks! Really appreciate the kind words 🙌

Right now, I’m keeping the pre-built images simple. just Cloudflare for now to keep things lightweight and maintainable.
But the good news is: you can absolutely build your own image with cache-handler support, and
it’s designed to be super easy.

Here’s the guide you’ll want to follow:
🔧 https://github.com/CaddyBuilds/caddy-cloudflare?tab=readme-ov-file#building-your-own-docker-image

If you fork the repo, I recommend giving it a more descriptive name (since image names are based on the repo name). Something like:

caddy-cloudflare-cache
or
caddy-cacheflare (just for fun 😄)

Then in both Dockerfile and Dockerfile.alpine, after this line:

--with github.com/caddy-dns/cloudflare

just add:

--with github.com/caddyserver/cache-handler

So you’ll end up with:

RUN xcaddy build \
    --with github.com/caddy-dns/cloudflare \
    --with github.com/caddyserver/cache-handler

Follow the rest of the "Build your own image" steps, and you’ll have a custom Caddy image with exactly what you need.

Let me know if you hit any bumps. Happy to help!

<!-- gh-comment-id:2983102867 --> @vkartk commented on GitHub (Jun 18, 2025): Hey, @nodesocket thanks! Really appreciate the kind words 🙌 Right now, I’m keeping the pre-built images simple. just Cloudflare for now to keep things lightweight and maintainable. But the good news is: **you can absolutely build your own image with `cache-handler` support**, and it’s designed to be super easy. Here’s the guide you’ll want to follow: 🔧 [https://github.com/CaddyBuilds/caddy-cloudflare?tab=readme-ov-file#building-your-own-docker-image](https://github.com/CaddyBuilds/caddy-cloudflare?tab=readme-ov-file#building-your-own-docker-image) If you fork the repo, I recommend giving it a more descriptive name (since image names are based on the repo name). Something like: **`caddy-cloudflare-cache`** or **`caddy-cacheflare`** (just for fun 😄) Then in both `Dockerfile` and `Dockerfile.alpine`, after this line: ```dockerfile --with github.com/caddy-dns/cloudflare ``` just add: ```dockerfile --with github.com/caddyserver/cache-handler ``` So you’ll end up with: ```dockerfile RUN xcaddy build \ --with github.com/caddy-dns/cloudflare \ --with github.com/caddyserver/cache-handler ``` Follow the rest of the "Build your own image" steps, and you’ll have a custom Caddy image with exactly what you need. Let me know if you hit any bumps. Happy to help!
Author
Owner

@nodesocket commented on GitHub (Jun 30, 2025):

@vkartk thanks for the detailed instructions. Anyway to limit the arch and distribution builds? I really only need linux amd64 and linux arm64?

<!-- gh-comment-id:3017952268 --> @nodesocket commented on GitHub (Jun 30, 2025): @vkartk thanks for the detailed instructions. Anyway to limit the arch and distribution builds? I really only need linux `amd64` and linux `arm64`?
Author
Owner

@nodesocket commented on GitHub (Jun 30, 2025):

Humm, I triggered a GitHub action of build and push and it's been running for over 20 minutes. Is that expected?

<!-- gh-comment-id:3017986907 --> @nodesocket commented on GitHub (Jun 30, 2025): Humm, I triggered a GitHub action of `build and push` and it's been running for over 20 minutes. Is that expected?
Author
Owner

@vkartk commented on GitHub (Jun 30, 2025):

Yep, totally normal. Building all arch/platforms can take 45–60 min, so 20+ min isn’t unusual.

Right now you’d need to edit:

  • .github/workflows/build-docker-image-alpine.yml
  • .github/workflows/build-docker-image-standard.yml
  • scripts/check_caddy_status.py

to limit it to just linux/amd64 and linux/arm64.

Good news: I’ll push an update soon so you can control platforms via GitHub vars much easier! 🚀

<!-- gh-comment-id:3018007035 --> @vkartk commented on GitHub (Jun 30, 2025): Yep, totally normal. Building all arch/platforms can take **45–60 min**, so 20+ min isn’t unusual. Right now you’d need to edit: * `.github/workflows/build-docker-image-alpine.yml` * `.github/workflows/build-docker-image-standard.yml` * `scripts/check_caddy_status.py` to limit it to just `linux/amd64` and `linux/arm64`. Good news: I’ll push an update soon so you can control platforms via **GitHub vars** much easier! 🚀
Author
Owner

@nodesocket commented on GitHub (Jun 30, 2025):

@vkartk ok cool. I restarted the GitHub action and sitting at 1h and 5m, but think it's stalled. Has not moved in a very long time.

28 [linux/arm/v7 builder 2/2] RUN xcaddy build     --with github.com/caddy-dns/cloudflare     --with github.com/caddyserver/cache-handler
#28 660.7 go: downloading github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65
#28 660.8 go: downloading github.com/lib/pq v1.10.9
#28 661.0 go: downloading github.com/zeebo/pcg v1.0.1
#28 661.5 go: downloading github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2
#28 661.7 go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7
#28 661.9 go: downloading github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5
#28 662.0 go: downloading golang.org/x/oauth2 v0.22.0
#28 662.2 go: downloading cloud.google.com/go/auth v0.4.1
#28 664.1 go: downloading cloud.google.com/go/auth/oauth2adapt v0.2.2
#28 664.1 go: downloading go.opencensus.io v0.24.0
#28 664.6 go: downloading cloud.google.com/go/compute/metadata v0.5.0
#28 665.1 go: downloading cloud.google.com/go/compute v1.23.3
#28 667.0 go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0
#28 667.5 go: downloading github.com/OneOfOne/xxhash v1.2.2
#28 667.9 go: downloading github.com/spaolacci/murmur3 v1.1.0
#28 668.2 go: downloading github.com/google/s2a-go v0.1.7
#28 670.9 go: downloading github.com/googleapis/enterprise-certificate-proxy v0.3.2
#28 671.8 go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
#28 674.8 2025/06/30 07:07:50 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath -tags nobadger,nomysql,nopgx 
<!-- gh-comment-id:3018180146 --> @nodesocket commented on GitHub (Jun 30, 2025): @vkartk ok cool. I restarted the GitHub action and sitting at `1h and 5m`, but think it's stalled. Has not moved in a very long time. ```shell 28 [linux/arm/v7 builder 2/2] RUN xcaddy build --with github.com/caddy-dns/cloudflare --with github.com/caddyserver/cache-handler #28 660.7 go: downloading github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 #28 660.8 go: downloading github.com/lib/pq v1.10.9 #28 661.0 go: downloading github.com/zeebo/pcg v1.0.1 #28 661.5 go: downloading github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 #28 661.7 go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 #28 661.9 go: downloading github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 #28 662.0 go: downloading golang.org/x/oauth2 v0.22.0 #28 662.2 go: downloading cloud.google.com/go/auth v0.4.1 #28 664.1 go: downloading cloud.google.com/go/auth/oauth2adapt v0.2.2 #28 664.1 go: downloading go.opencensus.io v0.24.0 #28 664.6 go: downloading cloud.google.com/go/compute/metadata v0.5.0 #28 665.1 go: downloading cloud.google.com/go/compute v1.23.3 #28 667.0 go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 #28 667.5 go: downloading github.com/OneOfOne/xxhash v1.2.2 #28 667.9 go: downloading github.com/spaolacci/murmur3 v1.1.0 #28 668.2 go: downloading github.com/google/s2a-go v0.1.7 #28 670.9 go: downloading github.com/googleapis/enterprise-certificate-proxy v0.3.2 #28 671.8 go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da #28 674.8 2025/06/30 07:07:50 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath -tags nobadger,nomysql,nopgx ```
Author
Owner

@github-actions[bot] commented on GitHub (Jul 30, 2025):

This issue has been automatically marked as stale due to inactivity. If no further activity occurs, it will be closed in 7 days.

<!-- gh-comment-id:3137580337 --> @github-actions[bot] commented on GitHub (Jul 30, 2025): This issue has been automatically marked as stale due to inactivity. If no further activity occurs, it will be closed in 7 days.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/caddy-cloudflare#9
No description provided.