]> git.ipfire.org Git - thirdparty/lxc.git/commit
Add suppport for PuzzleFS images in the oci template 4483/head
authorAriel Miculas-Trif <amiculas@cisco.com>
Wed, 18 Sep 2024 10:07:46 +0000 (13:07 +0300)
committerAriel Miculas-Trif <amiculas@cisco.com>
Fri, 4 Oct 2024 18:51:03 +0000 (21:51 +0300)
commit3764c19967286a9cb193485fadec3181c62fe241
tree991fde8082d8751ae841d7b3a9399ce868b81b1b
parent52326514c64b6622368475307d7a7a76c3ee3780
Add suppport for PuzzleFS images in the oci template

PuzzleFS images (media type 'application/vnd.puzzlefs.image.rootfs.v1')
can be mounted in a similar way to squashfs images, we just have to
detect the type and reuse the existing code for providing a mount
helper. PuzzleFS is a next-generation container filesystem [1] with
several benefits, such as  reduced duplication, reproducible image
builds, direct mounting support and memory safety guarantees.

Since PuzzleFS currently doesn't provide an image config, also add
support for empty image configs, they are supported by the OCI spec [2].

The MOUNT_HELPER is now passed a `--persist <upperdir>` flag, so it
knows that it needs to create an overlay. This is needed because LXC
expects a writable rootfs and both atomfs and puzzlefs are read-only
filesystems.

Example:
```
$ sudo env PATH=$PATH build/src/lxc/tools/lxc-create --name mycontainer -t \
oci -- --url oci:/$HOME/.local/share/puzzlefs/pfs_ubuntu:eg --no-cache

$ sudo build/src/lxc/tools/lxc-start --name mycontainer --foreground /bin/bash
```

--no-cache is needed for puzzlefs until [3] is solved

[1] https://github.com/project-machine/puzzlefs
[2] https://github.com/opencontainers/image-spec/blob/main/manifest.md#image-manifest
[3] https://github.com/project-machine/puzzlefs/issues/131

Signed-off-by: Ariel Miculas-Trif <amiculas@cisco.com>
templates/lxc-oci.in