Skip to content

📖 A proxy that makes the GitHub Container Registry compatible with the Docker Registry HTTP API V2 specification.

License

Notifications You must be signed in to change notification settings

willdurand/container-registry-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Container Registry Proxy

CI codecov

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.

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=<personal access 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 file for details.

About

📖 A proxy that makes the GitHub Container Registry compatible with the Docker Registry HTTP API V2 specification.

Topics

Resources

License

Stars

Watchers

Forks