Skip to content

Conversation

@Mxucc
Copy link

@Mxucc Mxucc commented Sep 26, 2025

Optimize Dockerfile for China-friendly builds with fallback mirrors

  • Prioritize Aliyun and Tsinghua mirrors for apt-get and pip to ensure fast and stable builds in China without VPN.
  • Implement retry logic (3 attempts, 60s timeout) for both apt-get and pip to handle network instability.
  • Add fallback to official Debian and PyPI sources for global compatibility.
  • Retain arm64 support and ImageMagick security policy fix.
  • Keep original structure with minimal changes for maintainability.

…itized domestic mirrors and fallback to global sources.
@andrewpjlewis
Copy link

Nice work on making the Dockerfile more accessible. I’m new to Docker, so I’m curious: what exactly makes these builds “China-friendly,” and how do they compare to builds in other regions?

@Mxucc
Copy link
Author

Mxucc commented Oct 9, 2025

Nice work on making the Dockerfile more accessible. I’m new to Docker, so I’m curious: what exactly makes these builds “China-friendly,” and how do they compare to builds in other regions?

Thanks! The "China-friendly" part basically means we're using fast, local mirrors in China (like Aliyun and Tsinghua) for downloading packages during the build. In China, the Great Firewall can make pulling from default global servers super slow or flaky, so this speeds things up a ton and adds retries/failovers to make it reliable.
Compared to other regions? Builds there usually just use the standard Debian or PyPI servers without issues—no need for extras since connections are stable and quick. This setup falls back to defaults anyway if the mirrors fail, so it works everywhere but shines in China.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants