I'm facing a frustrating issue with pushing large Docker images, specifically those that include very large layers (around 10GB). Here's some context:
I have Gitea running on-prem in my company network within a Docker container, and I'm using Caddy to serve it. We scale using Hetzner Cloud, which connects to our on-prem setup via a site-to-site IPsec VPN. In the Hetzner cloud, our VPN gateway runs Docker with an Nginx-based registry proxy, based on a specific GitHub project I found. I've made some tweaks to the proxy configuration for performance and caching behavior.
When I try to push an image with that large layer, it always fails. By passing the proxy, I can successfully push the same image without any issues, indicating the reverse proxy is the culprit. The error code from Nginx shows a proxy connection issue: 'upstream read timed out'.
I've increased various timeout settings in my Nginx configuration, including timeouts related to proxy connections, but I'm still facing the same problems with large layer uploads. I'm really stuck and could use some help figuring this out. Any advice?
4 Answers
Just to add, that large layer could be indicative of a bottleneck – often people include heavy assets in their images. Although you're creating a large layer for Visual Studio installation which makes sense, it’s still pretty hefty! Have you checked if the problem lies with Nginx or the proxy_connect module?
You might want to simplify the location block in your Nginx config to ensure that the regex is matching correctly. Also, during your Docker build, running `nginx -T` will print out the entire configuration. This can help you make sure your environment variables are converting properly into Nginx settings.
Just a quick note: I think I've resolved the issue! Sometimes, it takes some tinkering, but it's good to see things working smoothly again.
This sounds like a known limit with Nginx that others have run into as well. I can't recall the documentation offhand, but many have experienced problems when dealing with large image layers. By the way, how do you end up with a layer that's 10GB? That's quite substantial!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically