If you're looking for proxy for helm, maybe you can try cloudflare-helm-proxy.
- 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 as your need:
4.1. use cloudflare worker host: only support proxy one registry- modify routes as follow: (in file
src/index.js
)
4.2. use custom domain: support proxy multiple registries route by host (assume your domain is yourdomain.com)const routes = { "${workername}.${username}.workers.dev/": "https://registry-1.docker.io", };
- modify routes according to your domain as follow: (in file
src/index.js
)
const routes = { "docker.yourdomain.com": "https://registry-1.docker.io", "quay.yourdomain.com": "https://quay.io", "gcr.yourdomain.com": "https://k8s.gcr.io", "k8s-gcr.yourdomain.com": "https://k8s.gcr.io", "ghcr.yourdomain.com": "https://ghcr.io", };
- modify routes as follow: (in file
- click the button, you will be redirected to the deploy page.
- if you choose 4.2 use custom domain in step 4, you need to do the following steps:
- host your domain DNS on cloudflare
- add all domains (which config in step 4.2. eg:
docker.yourdomain.com
,quay.yourdomain.com
etc.) to Custom Domains of the worker you have deployed.
*Attention: Click Triggers in the worker page to show Custom Domains and Routes info.
- modify
/etc/docker/daemon.json
, add registry-mirrors as follow:- if you choose 4.1 use cloudflare worker host.
Change the following url to your actually url (which you can find in Preview or Routes of your worker).
{ "registry-mirrors": ["https://<workername>.<username>.workers.dev"] }
- if you choose 4.2 use custom domain
{ "registry-mirrors": ["https://docker.yourdomain.com"] }
- if you choose 4.1 use cloudflare worker host.
- restart docker daemon
systemctl restart docker.service
Enjoy yourself!