Skip to content

gythialy/cloudflare-docker-proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloudflare-docker-proxy

deploy

Deploy to Cloudflare Workers

If you're looking for proxy for helm, maybe you can try cloudflare-helm-proxy.

Deploy

  1. click the "Deploy With Workers" button
  2. follow the instructions to fork and deploy
  3. update routes as you requirement

Deploy to Cloudflare Workers

Routes configuration tutorial

  1. use cloudflare worker host: only support proxy one registry

    const routes = {
      "${workername}.${username}.workers.dev/": "https://registry-1.docker.io",
    };
  2. use custom domain: support proxy multiple registries route by host

    • host your domain DNS on cloudflare
    • add A record of xxx.example.com to 192.0.2.1
    • deploy this project to cloudflare workers
    • add xxx.example.com/* to HTTP routes of workers
    • add more records and modify the config as you need
    const routes = {
      "docker.libcuda.so": "https://registry-1.docker.io",
      "quay.libcuda.so": "https://quay.io",
      "gcr.libcuda.so": "https://k8s.gcr.io",
      "k8s-gcr.libcuda.so": "https://k8s.gcr.io",
      "ghcr.libcuda.so": "https://ghcr.io",
    };
  3. deploy by wrangler

# replace libcuda.so to your domain in wrangler.toml
sed -i 's/libcuda.so/${CUSTOM_DOMAIN}/g' wrangler.toml
# install install dependencies
yarn
# deploy
yarn wrangler deploy --env production --minify src/index.js

Usage

# busybox:stable ==> docker.libcuda.so/busybox:stable
docker pull docker.libcuda.so/busybox:stable
# or
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-EOF
{
    "registry-mirrors": [
        "https://docker.libcuda.so",
    ]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
docker pull busybox:stable

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 58.2%
  • HTML 41.8%