この紹介文は現在英語版のみです。
Cloudflare Docker Proxy
Cloudflare Docker Proxy is a lightweight solution that leverages Cloudflare Workers to create a proxy for Docker registries. It helps accelerate image pulling and bypass network restrictions by routing Docker registry requests through Cloudflare’s global network.
Core Features
- Multiple Registry Support: Proxy multiple Docker registries (Docker Hub, GitHub Container Registry, Quay.io, etc.)
- Custom Domain Routing: Route different registries through different subdomains
- No Infrastructure Required: Runs entirely on Cloudflare’s edge network
- Simple Deployment: One-click deployment to Cloudflare Workers
- Cost-Effective: Operates within Cloudflare Workers’ free tier for most use cases
- Low Latency: Leverages Cloudflare’s global network for faster downloads
Common Use Cases
- Accelerating Docker image downloads in regions with poor connectivity to official registries
- Bypassing network restrictions that may block direct access to container registries
- Setting up a unified access point for multiple container registries
- Creating a consistent endpoint for containerized applications across different environments
How It Works
The proxy works by:
- Receiving Docker registry API requests at your Cloudflare Workers endpoint
- Routing these requests to the appropriate registry based on the hostname
- Streaming the response back to the client through Cloudflare’s network
Quick Setup
-
Deploy to Cloudflare Workers:
- Click the “Deploy With Workers” button on the GitHub repository
- Follow the instructions to fork and deploy the project
-
Configure Routes: There are two main configuration options:
Option 1: Using Cloudflare Worker domain (for single registry)
const routes = { "${workername}.${username}.workers.dev/": "https://registry-1.docker.io", };Option 2: Using custom domain (for multiple registries)
const routes = { "docker.example.com": "https://registry-1.docker.io", "quay.example.com": "https://quay.io", "ghcr.example.com": "https://ghcr.io", }; -
DNS Configuration (for custom domains):
- Host your domain DNS on Cloudflare
- Add A records pointing your subdomains to
192.0.2.1 - Configure Cloudflare Workers routes (e.g.,
*.example.com/*)
Using Your Docker Registry Proxy
Once configured, you can pull images using your proxy:
# Instead of
docker pull nginx:latest
# Use your proxy
docker pull docker.example.com/library/nginx:latest
This project is especially useful for developers and organizations in regions where direct access to Docker registries is slow or restricted.