How to use incus-simplestreams with images published from containers

I tried to use incus-simplestreams to make an images website from images that I create from containers.

When I publish a container into an image and then export the image, I get a single .tar.gz file containing rootfs/, metadata.yaml, and templates/.

incus-simplestreams seems to require a squashfs file with rootfs, and a tar.xz file with metadata.yaml and template/. So I had to extract rootfs from the .tar.gz file and convert it to a squashfs file, using mksquashfs. I also had to unpack metadata.yaml and templates/ from the .tar.gz file and repack them into a tar.xz file.

Is there a way to simplify this process? Can I publish/export the image from incus in the format required by incus-simplestreams?

:thinking: Not so helpful maybe, but Image format - Incus documentation mentions two types of image formats (a unified tarball and split tarballs (what you seem to need)), but I can’t find any information how to tell the incus image export command to use a different format.

Maybe a missing feature.

Interesting:
Distrobuilder supports defining the type:

The --type flag can take one of the
following values:

  • split (default)
  • unified

As an alternative you could use an incus server:

Found this:

It is indeed a missing feature, but as stgraber said there, you should be able to automate it.

Using Distrobuilder is a whole different procedure than publishing images from containers. The images in images.linuxcontainers.org are probably all built using Distrobuilder.

Incus can import multiple image formats but simplestreams only supports the split format?

I’ve avoided sharing images via an incus server, because:

  • I don’t want to dedicate an incus host just for serving images
  • I don’t think it’s a good idea to use a production server with private instances to also serve public images. Even if it is technically feasible, I would worry about misconfiguring it.
  • I assume an incus server manages images of a single architecture, but I use both x86 and arm images.

I’ve been wanting to have my own simplestreams server for a long time. incus-simplestreams makes this feasible.

I added a feature request ([Feature Request] add --type flag to incus image export · Issue #871 · lxc/incus · GitHub), I assume that stgraber will add the request to “easy issues” so it will probably be low-priority, but if some volunteers and maintainers see it, who knows maybe someone will implement it.