Bash automation script for simplified deployment of https://github.com/cloudflare/serverless-registry
Prerequisites:
- A Cloudflare account (find and copy account ID).
- Activated Cloudflare R2 subscription
- A Cloudflare API token with the following permissions:
Account:Workers R2 Storage:Edit
Account:Workers KV Storage:Edit
Account:Workers Scripts:Edit
User:Memberships:Read
User:User Details:Read
- Upstream registry url, username and password. In the case of Docker Hub (url would be
index.docker.io
) - username and a PAT (personal access token) withRead & Write
permissions. pnpm
wrangler
- Clone the repository
- Fill in the values at the top of the
cf-registry-automation.sh
/ provide values via command line arguments. Refer tocf-registry-automation.sh --help
for more information - Run the script
- Authenticate with your newly configured registry and try pulling some base image from upstream registry, for example:
docker pull <your-registry-url>/node:20
, which should automatically resolve todocker pull <upstream-registry-url>/node:20
and pull the image from upstream registry through your Cloudflare registry, and cache it in R2 for future use.