/cloudflare-registry-proxy

A docker registry proxy run on cloudflare worker.

Primary LanguageJavaScript

cloudflare-docker-proxy

deploy

Deploy

Deploy to Cloudflare Workers

  1. 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.)
  2. fork this project
  3. modify the link of the above button to your fork url
  4. 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",
    };
  5. click the button, you will be redirected to the deploy page.
  6. 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.

Config Docker mirrors

  1. modify /etc/docker/daemon.json, add registry-mirrors as follow:
     {
         "registry-mirrors": ["https://docker-proxy.yourdomain.com"]
     }
  2. restart docker daemon