Issues Pushing Large Docker Images Through Nginx

0
7
Asked By TechieWanderer93 On

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

Answered By DockerDude56 On

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?

Answered By CodeCrusader42 On

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.

Answered By HappyDevFindsFix On

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.

Answered By DevOpsGuru88 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.