go-containerregistry icon indicating copy to clipboard operation
go-containerregistry copied to clipboard

Support v1 tarball as stream?

Open deitch opened this issue 4 years ago • 9 comments

Is it possible to extend package v1/tarball to support streaming access, i.e. create a v1.Image and v1.ImageIndex not from a file on disk, but from a tar stream instead?

As far as I can see, the only options are ImageFromPath and (the function it wraps) Image. The former takes an actual path, while the latter works with an Opener. I thought the latter might work, but it calls the Opener multiple times and reads things through, which wouldn't work with a stream.

My use case is that I am getting an image stream - e.g. a tar stream in oci tarball layout format, or just running docker buildx build --output=type=oci which outputs to stdout - and was to then use it. I might save it to v1/layout or push it to a registry or a whole bunch of things, but first I need to make it useful to other parts of this library, which means I need to generate a v1.Image or v1.ImageIndex.

deitch avatar Feb 04 '21 13:02 deitch