https://github.com/willdurand/container-registry-proxy
📖 A proxy that makes the GitHub Container Registry compatible with the Docker Registry HTTP API V2 specification.
https://github.com/willdurand/container-registry-proxy
container-registry container-registry-proxy
Last synced: 3 months ago
JSON representation
📖 A proxy that makes the GitHub Container Registry compatible with the Docker Registry HTTP API V2 specification.
- Host: GitHub
- URL: https://github.com/willdurand/container-registry-proxy
- Owner: willdurand
- License: mit
- Created: 2023-03-18T13:57:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T09:30:27.000Z (4 months ago)
- Last Synced: 2025-03-28T01:47:48.075Z (4 months ago)
- Topics: container-registry, container-registry-proxy
- Language: Go
- Homepage: https://williamdurand.fr/2023/03/18/github-container-registry-proxy-and-synology/
- Size: 54.7 KB
- Stars: 13
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Container Registry Proxy
[](https://github.com/willdurand/container-registry-proxy/actions/workflows/ci.yml) [](https://codecov.io/gh/willdurand/container-registry-proxy)

This is a container registry proxy that is mainly used to make the GitHub
Container Registry fully compatible with the [Docker Registry HTTP API V2
specification][http-api].Important: This small application is designed for a specific use case in mind so
it is very likely that it isn't going to solve _your_ problems. For more information,
read [my blog post about this project][blogpost].## Environment variables
- `GITHUB_TOKEN`: required - a GitHub (personal access) token with `read:packages` permission
- `HOST`: optional - the proxy address (default: `127.0.0.1`)
- `PORT`: optional - the proxy port (default: `10000`)
- `UPSTREAM_URL`: optional - the URL of the upstream container registry (default: `https://ghcr.io`)
- `GITHUB_PACKAGES_OWNER`: optional - the name of a packages owner (GitHub username). Useful to retrieve packages from a user that isn't the user authenticated with the `GITHUB_TOKEN`## Quick start
1. Go to https://github.com/settings/tokens and generate a classic token with
the `read:packages` scope.
2. Run the proxy using Docker:```
$ docker run --rm -e GITHUB_TOKEN= willdurand/container-registry-proxy
2023/03/18 13:53:27 starting container registry proxy on 127.0.0.1:10000
```## Docker on Synology
1. Go to https://github.com/settings/tokens and generate a classic token with
the `read:packages` scope.
2. In _DSM_, create a new container using the `willdurand/container-registry-proxy`
image available on the Docker Hub. Make sure to define a `GITHUB_TOKEN`
environment variable with the value generated in the previous step. Also, add
this container to the "host" network.
3. Next, configure a new registry in _DSM > Docker > Registry > Settings_, e.g.
`GitHub Registry (Proxied)` with a dummy URL for now (we'll change it
manually later), e.g. `http://nas.local:10000`. You must configure a GitHub
username and the password should be the GitHub token generated previously.
4. SSH into the Synology and open `/var/packages/Docker/etc/registry.json` using
elevated privileges (i.e. `sudo vim`). Change `nas.local` to `127.0.0.1`,
save and quit.At this point, the registry proxy is fully configured. In _DSM > Docker >
Registry > Settings_, select the newly added registry and click "Use". You
should now see the list of images.## License
See the bundled [LICENSE](./LICENSE) file for details.
[http-api]: https://docs.docker.com/registry/spec/api/
[blogpost]: https://williamdurand.fr/2023/03/18/github-container-registry-proxy-and-synology/