Added fallback for docker.io registry in Docker proxy configuration
#78
Reference in New Issue
Block a user
Delete Branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
查阅了代码之后,发现有一个简易的实现方案:在registry配置中,解析一个默认的字符串“docker.io”,在detectRegistryDomain函数中增加一个默认的处理逻辑,如果registry配置中有对docker.io的镜像配置,则使用,否则使用dockerProxy来处理镜像逻辑
Summary by CodeRabbit
New Features
Bug Fixes
Walkthrough
Updated docker registry handling: imports added; RegistryDetector.detectRegistryDomain now short-circuits to docker.io when configured; InitDockerProxy initializes a default registry handle for registry-1.docker.io using utils.GetGlobalHTTPClient().Transport and emits a prelude newline.
Changes
src/handlers/docker.goSequence Diagram(s)
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands and usage tips.这个提交会修复 https://github.com/sky22333/hubproxy/issues/77
@sky22333
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
3f614e8011and426b1344f2.📒 Files selected for processing (1)
src/handlers/docker.go(3 hunks)🔇 Additional comments (2)
⚠️ Potential issue | 🔴 Critical
Fallback logic incorrectly routes unrecognized registries to docker.io.
The current implementation treats ANY path without a matching registry prefix as a docker.io image. This causes incorrect routing when paths contain unrecognized registry domains.
Problem: Given path
quay.io/myorg/imagewherequay.iois not configured butdocker.iois configured:("docker.io", "quay.io/myorg/image")docker.io/quay.io/myorg/image❌The fallback should only apply to paths without a registry-like prefix (e.g.,
library/nginx), not to paths with unknown registry domains (e.g.,quay.io/image).Apply this diff to fix the logic:
🤖 Prompt for AI Agents
Pull request closed