We made our ghcr.io 2x faster with AWS CloudFront @gerhardlazu
We made our ghcr.io 2x faster with AWS CloudFront  @gerhardlazu
Uploaded August 2025 | Updated September 2026, 2 weeks ago
Together with Matias Pan & Marcos Nils, our primary goal was to establish a container registry operating through CloudFront, effectively positioning CloudFront as a frontend for ghcr.io.

While ghcr.io provides a generous free tier that served us well for years, the existing analytics on ghcr.io offer limited insights, latency is sometimes poor, and unavailability hits hard. A custom domain allows us to gather more granular data, makes requests consistently faster & more reliable anywhere in the world, and we have the option of switching container registries without disrupting users.

A significant challenge in this project was understanding the HTTPS traffic between the user's machine and the CloudFront endpoint. To do this without the complexity of a man-in-the-middle proxy, we used eCapture, a powerful tool that leverages eBPF (Extended Berkeley Packet Filter) to capture SSL/TLS traffic in plaintext. This allowed us to inspect the requests and responses, understand the authentication flow, and identify which requests to cache.

By using eCapture, we demonstrate that the new setup works as expected. We show how the Docker CLI interacts with the CloudFront endpoint, how the token is fetched, and how the manifest and blobs are pulled. We also demonstrate that the caching is working correctly, with subsequent requests for the same image being served from the CloudFront cache, resulting in a significant performance improvement - it's 100% faster.

We plan to continue optimizing this setup including:
- Caching the token: To limit the impact of ghcr.io service disruption
- Fine-tuning the caching policies: To further improve performance and reduce costs
- Origin shield: To reduce the load on ghcr.io

There is more to this:
- Sign-up at ๐Ÿ“บ makeitwork.tv for the full length content
- Tune into ๐ŸŽง https://makeitwork.fm for the podcast
- Join ๐Ÿชฉ makeitwork.club for regular members-only discussions

00:00 Intro
00:36 What are we trying to achieve?
01:44 Why custom domain for ghcr.io?
03:34 registry-redirect
05:48 vector.dev
07:45 ecapture
14:44 ecapture new image from registry.dagger.io
21:56 Does it work?
29:47 How can we improve on this?
31:56 Is it faster than ghcr.io?
36:59 How to set this up
42:58 Follow-up optimisations
We made our ghcr.io 2x faster with AWS CloudFrontLearning from Matts homelab: Incus, Ansible and NO Kubernetes.eCapture.cc SSL/TLS in plaintext #ebpf #ssl #tlsHunting double slashes #elixir #varnish #cdnLets build a CDN - Part 2starship explainTrust me, the docs are good and up-to-dateSupercharge your development workflow with these CLI toolsThe OG BikeshedThe Square Hole - KubeCon EU 2024 proposed talk - Ken Cochrane & Gerhard LazuDeploying and Experimenting with Dagger 0.9 on Kubernetes 1.28Best homelab moments are shared
Gerhard Lazu |

We made our ghcr.io 2x faster with AWS CloudFront

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER