Alsan / cloudflare-docker-proxy

A docker registry proxy run on cloudflare worker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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. fork this project
  2. modify the link of the above button to your fork url
  3. click the button, you will be redirected to the deploy page

Deploy to Cloudflare Workers

Config 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. Have to host your domain DNS on cloudflare.
# replace libcuda.so to your domain in both src/index.js and wrangler.toml
sed -i 's/libcuda.so/${your_domain}/g' src/index.js
sed -i 's/libcuda.so/${your_domain}/g' wrangler.toml
# install install dependencies
yarn
# deploy
npx 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

About

A docker registry proxy run on cloudflare worker.


Languages

Language:JavaScript 100.0%