-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add local-image-proxy command to proxy container image fetches #10075
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: cgwalters The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Other notes
|
This command runs a webserver that can fetch manifests and blobs; it's a bit like an OCI/Docker Distribution API except we can fetch from multiple registries. It may be more useful to think of it as a streaming HTTP version of `podman pull`. The primary intended use case is for ostree+containers integration. What we want is to fetch and *stream* the underlying tarball from a container image that will be unpacked and used for operating system updates. The ostree code here will do things like validate the embedded OSTree signatures inside the tarball. Design constraints/goals: - This should not read or write to the containers/image storage; we want to stream the result and have other code unpack it into the target ostree repo. I don't want to have to think about any potential interactions between the operating system update mechanism/storage and container storage. - I want to stream instead of pulling the whole image to a temporary directory and then re-parse it. - But, crucially we *do* want to reuse any configuration in `/etc/containers/registries.conf` particularly around mirroring. In particular for e.g. OpenShift it must work to set up Image Content Source Policy to pull from a local registry mirror of the CoreOS update stream. - We want to reuse the containers/image default handling for authentication (`~/.docker/config.json` etc.) - I'd really rather not vendor in all of containers/image into another program and have to keep it up to date - ostree is in C and Rust, adding Go in-process would be a *huge* change - By having this out of process, it can easily be runnable fully unprivileged under e.g. a transient uid to fully ensure it has no effect on the system and can be sandboxed. It's of course a bonus here if we also support containers signing, etc. The expected primary use case is that ostree tooling allocates a `socketpair()` and passes it down to skopeo, which will run a webserver on that anonymous socketpair. For ease of debugging/testing, we also support listening on a localhost TCP port. More information here: https://github.com/ostreedev/ostree-rs-ext/tree/b84955aa170bf4b5518603547f33d1aec7719f44#pulling-an-ostree-container-directly
Hmm and a deeper problem here is I really want this command to be runnable inside a container; all it does is HTTP requests. But it looks like all of the containers/common machinery entangles things like "parse |
Should this be a podman system proxy? podman image proxy? |
This feels a bit more Skopeo than Podman... A special transport so |
I actually originally wrote this patch for skopeo, then changed my mind because it feels like the long term direction is to avoid having lots of binaries vendoring and re-exporting the containers/ library stack. We need to keep podman and cri-o up to date for example but skopeo isn't currently critical path for anything. That said, I agree it does more clearly fit into skopeo so...happy to close this and reopen there if that's the consensus. |
There is precedent for including other commands in Podman (Buildah and |
OK will move to skopeo. |
This initiative moved to https://github.com/cgwalters/container-image-proxy for now, but I still plan to propose for skopeo at some point probably soon. |
This command runs a webserver that can fetch manifests and blobs;
it's a bit like an OCI/Docker Distribution API except we can fetch
from multiple registries. It may be more useful to think of it
as a streaming HTTP version of
podman pull
.The primary intended use case is for ostree+containers integration.
What we want is to fetch and stream the underlying tarball from a container
image that will be unpacked and used for operating system updates.
The ostree code here will do things like validate the embedded
OSTree signatures inside the tarball.
Design constraints/goals:
want to stream the result and have other code unpack it
into the target ostree repo. I don't want to have to think about
any potential interactions between the operating system update mechanism/storage
and container storage.
directory and then re-parse it.
/etc/containers/registries.conf
particularly around mirroring. In particular for e.g. OpenShift
it must work to set up Image Content Source Policy to pull from
a local registry mirror of the CoreOS update stream.
authentication (
~/.docker/config.json
etc.)another program and have to keep it up to date
uid to fully ensure it has no effect on the system and can be sandboxed.
It's of course a bonus here if we also support containers signing, etc.
The expected primary use case is that ostree tooling allocates a
socketpair()
and passes it down to skopeo, which will run a webserver on that anonymous
socketpair.
For ease of debugging/testing, we also support listening on a localhost TCP port.
More information here: https://github.com/ostreedev/ostree-rs-ext/tree/b84955aa170bf4b5518603547f33d1aec7719f44#pulling-an-ostree-container-directly