lxc / incus

Powerful system container and virtual machine manager
https://linuxcontainers.org/incus
Apache License 2.0
2.73k stars 224 forks source link

Add support for split image publishing #871

Open toby63 opened 6 months ago

toby63 commented 6 months ago

Required information

Request description

Followup to https://discuss.linuxcontainers.org/t/how-to-use-incus-simplestreams-with-images-published-from-containers/19947/4

A user wanted to export container/images in split format to be able to use the files directly with a simplestreams server.

Distrobuilder supports the following:

    following values:

        - split (default)
        - unified

I assume something similar could be added here as well.

In addition also the compression method could be changeable, but that is a different request.

stgraber commented 6 months ago

That's not possible, incus image export exports the image, an image cannot change type without changing hash and structure, so what you get from incus image export is always what you got into Incus in the first place.

toby63 commented 6 months ago

Well, back in the day you said otherwise. I also don't think it's impossible, just not as straightforward.

It also does not have to be the command incus image export, it could be something different like incus publish, as that was the intended goal of the original reporter.

melato commented 6 months ago

It looks like the feature request should be changed to: Add a flag to "incus publish", to publish the container in the split tarball image format.

stgraber commented 6 months ago

Yeah, having incus publish be able to create split images is indeed a different request and that one would be possible to do.

toby63 commented 6 months ago

I changed the title, so request for reopening please @stgraber.

melato commented 5 months ago

Since this is needed in order to add the image to simplestreams, it can also be done by a command in incus-simplestreams. For example: incus-simplestreams split-image .

I made the original post in the forum. I already wrote a utility for this, so I may provide a pull request for incus-simplestreams.

It could also be handled in incus-simplestreams add. If a single argument is provided, it can be assumed to be a unified tarball, and converted to split tarballs before adding to simplestreams.

stgraber commented 5 months ago

Since this is needed in order to add the image to simplestreams, it can also be done by a command in incus-simplestreams. For example: incus-simplestreams split-image .

Actually, it isn't. There is support in Incus simplestreams for unified images by using the incus_combined.tar.gz FileType so this could be used to publish such images.