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.
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.
GITHUB_TOKEN
: required - a GitHub (personal access) token withread:packages
permissionHOST
: 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 theGITHUB_TOKEN
-
Go to https://github.com/settings/tokens and generate a classic token with the
read:packages
scope. -
Run the proxy using Docker:
$ docker run --rm -e GITHUB_TOKEN=<personal access token> willdurand/container-registry-proxy 2023/03/18 13:53:27 starting container registry proxy on 127.0.0.1:10000
- Go to https://github.com/settings/tokens and generate a classic token with
the
read:packages
scope. - In DSM, create a new container using the
willdurand/container-registry-proxy
image available on the Docker Hub. Make sure to define aGITHUB_TOKEN
environment variable with the value generated in the previous step. Also, add this container to the "host" network. - 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. - SSH into the Synology and open
/var/packages/Docker/etc/registry.json
using elevated privileges (i.e.sudo vim
). Changenas.local
to127.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.
See the bundled LICENSE file for details.