- create an cloudflare API Token first (token ONLY SHOW ONCE), Account ID is needed. (Account ID is different from Login ID. If Account ID Not Found, create an Application in cloudflare workers page first.)
- fork this project
- modify the link of the above button to your fork url
- modify routes according to your domain as follow: (in file
src/index.js
)const routes = { "docker-proxy.yourdomain.com": "https://registry-1.docker.io", "quay-proxy.yourdomain.com": "https://quay.io", "gcr-proxy.yourdomain.com": "https://gcr.io", "ghcr-proxy.yourdomain.com": "https://ghcr.io", "k8s-proxy.yourdomain.com": "https://registry.k8s.io", };
- click the button, you will be redirected to the deploy page.
- do the following steps:
- host your domain DNS on cloudflare
- Click Triggers in the worker page to show Custom Domains and Routes info.
- add all domains (which config in step 4. eg:
docker-proxy.yourdomain.com
,quay-proxy.yourdomain.com
etc.) to Custom Domains of the worker you have deployed.
- modify
/etc/docker/daemon.json
, add registry-mirrors as follow:{ "registry-mirrors": ["https://docker-proxy.yourdomain.com"] }
- restart docker daemon