{"id":13737685,"url":"https://github.com/cloudflare/serverless-registry","last_synced_at":"2025-05-14T18:06:44.980Z","repository":{"id":208496904,"uuid":"712460593","full_name":"cloudflare/serverless-registry","owner":"cloudflare","description":"A container registry backed by Workers and R2.","archived":false,"fork":false,"pushed_at":"2025-03-10T18:05:33.000Z","size":426,"stargazers_count":1150,"open_issues_count":8,"forks_count":57,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-13T19:50:02.970Z","etag":null,"topics":["artifacts","cloudflare","container","container-registry","containers","docker","docker-registry","javascript","r2","registry","typescript","workers"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudflare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-31T14:12:24.000Z","updated_at":"2025-04-13T13:05:26.000Z","dependencies_parsed_at":"2024-03-08T13:25:18.119Z","dependency_job_id":"903a7249-fed1-4750-88e2-724b1e11785f","html_url":"https://github.com/cloudflare/serverless-registry","commit_stats":null,"previous_names":["cloudflare/serverless-registry"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fserverless-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fserverless-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fserverless-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fserverless-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudflare","download_url":"https://codeload.github.com/cloudflare/serverless-registry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198514,"owners_count":22030965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artifacts","cloudflare","container","container-registry","containers","docker","docker-registry","javascript","r2","registry","typescript","workers"],"created_at":"2024-08-03T03:01:57.191Z","updated_at":"2025-05-14T18:06:39.960Z","avatar_url":"https://github.com/cloudflare.png","language":"TypeScript","readme":"# Container Registry in Workers\n\nThis repository contains a container registry implementation in Workers that uses R2.\n\nIt supports all pushing and pulling workflows. It also supports\nUsername/Password and public key JWT based authentication.\n\n### Deployment\n\nYou have to install all the dependencies with [pnpm](https://pnpm.io/installation) (other package managers may work, but only pnpm is supported.)\n\n```bash\n$ pnpm install\n```\n\nAfter installation, there is a few steps to actually deploy the registry into production:\n\n1. Have your own `wrangler` file.\n\n```bash\n$ cp wrangler.toml.example wrangler.toml\n```\n\n2. Setup the R2 Bucket for this registry\n\n```bash\n$ npx wrangler --env production r2 bucket create r2-registry\n```\n\nAdd this to your `wrangler.toml`\n\n```\nr2_buckets = [\n    { binding = \"REGISTRY\", bucket_name = \"r2-registry\"}\n]\n```\n\n3. Deploy your image registry\n\n```bash\n$ npx wrangler deploy --env production\n```\n\nYour registry should be up and running. It will refuse any requests if you don't setup credentials.\n\n### Adding username password based authentication\n\nSet the USERNAME and PASSWORD as secrets with `npx wrangler secret put USERNAME --env production` and `npx wrangler secret put PASSWORD --env production`.\n\n### Adding JWT authentication with public key\n\nYou can add a base64 encoded JWT public key to verify passwords (or token) that are signed by the private key.\n`npx wrangler secret put JWT_REGISTRY_TOKENS_PUBLIC_KEY --env production`\n\n### Using with Docker\n\nYou can use this registry with Docker to push and pull images.\n\nExample using `docker push` and `docker pull`:\n\n```bash\nexport REGISTRY_URL=your-url-here\n\n# Replace $PASSWORD and $USERNAME with the actual credentials\necho $PASSWORD | docker login --username $USERNAME --password-stdin $REGISTRY_URL\ndocker pull ubuntu:latest\ndocker tag ubuntu:latest $REGISTRY_URL/ubuntu:latest\ndocker push $REGISTRY_URL/ubuntu:latest\n\n# Check that pulls work\ndocker rmi ubuntu:latest $REGISTRY_URL/ubuntu:latest\ndocker pull $REGISTRY_URL/ubuntu:latest\n```\n\n### Configuring Pull fallback\n\nYou can configure the R2 registry to fallback to another registry if\nit doesn't exist in your R2 bucket. It will download from the registry\nand copy it into the R2 bucket. In the next pull it will be able to pull it directly from R2.\n\nThis is very useful for migrating from one registry to `serverless-registry`.\n\nIt supports both Basic and Bearer authentications as explained in the\n[registry spec](https://distribution.github.io/distribution/spec/auth/token/).\n\nIn the wrangler.toml file:\n\n```\n[env.production.vars]\nREGISTRIES_JSON = \"[{ \\\"registry\\\": \\\"https://url-to-other-registry\\\", \\\"password_env\\\": \\\"REGISTRY_TOKEN\\\", \\\"username\\\": \\\"username-to-use\\\" }]\"\n```\n\nSet as a secret the registry token of the registry you want to setup\npull fallback in.\n\nFor example [gcr](https://cloud.google.com/artifact-registry/docs/reference/docker-api):\n\n```\ncat ./registry-service-credentials.json | base64 | npx wrangler secret put REGISTRY_TOKEN --env production\n```\n\n[Github](https://github.com/settings/tokens) for example uses a simple token that you can copy.\n\n```\necho $GITHUB_TOKEN | npx wrangler secret put REGISTRY_TOKEN --env production\n```\n\nThe trick is always looking for how you would login in Docker for\nthe target registry and setup the credentials.\n\n**Never put a registry password/token inside the wrangler.toml, please always use `wrangler secrets put`**\n\nYou can also use docker.io with anonymous authentication:\n```\nREGISTRIES_JSON = \"[{ \\\"registry\\\": \\\"https://index.docker.io/\\\" }]\"\n```\n\nYou can also set your `docker.io` credentials in the configuration to not have any rate-limiting.\n\n\n### Known limitations\n\nRight now there is some limitations with this container registry.\n\n- Pushing with docker is limited to images that have layers of maximum size 500MB. Refer to maximum request body sizes in your Workers plan.\n- To circumvent that limitation, you can either manually interact with the R2 bucket to upload the layer or take a\n  peek at the `./push` folder for some inspiration on how can you push big layers.\n- If you use `npx wrangler dev` and push to the R2 registry with docker, the R2 registry will have to buffer the request on the Worker.\n\n## License\n\nThe project is licensed under the [Apache License](https://opensource.org/licenses/apache-2.0/).\n\n### Contribution\n\nSee `CONTRIBUTING.md` for contributing to the project.\n","funding_links":[],"categories":["TypeScript","Data \u0026 Storage"],"sub_categories":["Storage Solutions"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Fserverless-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudflare%2Fserverless-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Fserverless-registry/lists"}