This repository has been archived by the owner on Jan 14, 2024. It is now read-only.
Container Registry Redirect #128
marcoceppi
started this conversation in
General
Replies: 1 comment 10 replies
-
Do you have any insight on cost? (Edit: so far we're paying for a domain and the github team plan, but this would be real infrastructure so just want to look at all our options because that's a one way trip, heh.) |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
With ISOs around the corner, we need to make sure we can support our ever evolving projects needs. Today we host all our images in ghcr.io but that may one day change. This proposal is to build and deploy a container registry redirect at
ublue.it
which will allow, via a YAML file, the ability to map container URLs such asublue.it/silverblue-main
andublue.it/kinoite-nvidia
as a redirects to one or more container registry backends.Goals
ublue.it/ubuntu
->ghcr.io/ublue-os/bluefin
&ublue.it/bluefin
->ghcr.io/ublue-os/bluefin
)Non-goals
Design
Either modify this existing Caddy implementation or build a small service either using something like NGINX, aiohttp, or net/http where the app can read in a simple configuration file and produce the correct 302 Location header when a valid URL is accessed.
Under the covers, a container URL such as
ghcr.io/ublue-os/bluefin
actually translates into a series of requests against against this base url:https://ghcr.io/v2/ublue-os/bluefin
.Ultimately when you enter a
ublue.it
image into a container engine (like podman, docker, rpm-ostree rebase, etc) and use an image URL likeublue.it/bluefin
; the container engine will translate that into a URL like thishttps://ublue.it/v2/library/bluefin/...
and use it for all requests. This service will return an HTTP 302 with a location header pointing tohttps://ghcr.io/v2/ublue-os/bluefin/...
which will cause the container engine to then follow that redirect and proceed with communicating to the Github API server to fetch metadata and the actual layer blobs.Github's own container registry actually implements a series of redirects themselves when accessing their
v2
container API. When you fetch a container blog it redirects to an object store URL.Alternatives
I spent a bit of time looking around and the closest implementations I could find are httptoolkit/docker-registry-facade and registry.k8s.io/archeio.
registry.k8s.io is the recently deployed registry redirect by the Kubernetes project that allowed them to migrate from k8s.gcr.io to auto redirecting between GCP and AWS based on where the request originates from and some other requirements. While this solution is great from a pure redirect and lots of value add for their users it won't fit some of our use cases.
docker-registry-facade is the closest to what we're trying to do by using Caddy. It's focused on a mostly transparent passthrough and with some modifications we could implement the goals of redirecting.
@akdev1l discovered blog.cloudflare.com/dynamic-redirect-rules which would help to implement mapping a domain to registries. However, the free tier has some limitations that may not work for this project.
Timeline
I'm looking to get started on this April 10th pending feedback and have an MVP available before Fedora 38 lands on April 18th.
Beta Was this translation helpful? Give feedback.
All reactions