rimerosolutions / entrusted

Sanitize documents to safe PDFs, for active content removal
GNU General Public License v3.0
25 stars 0 forks source link

Live CD: Investigate Nerdctl image storage #34

Closed yveszoundi closed 1 year ago

yveszoundi commented 1 year ago

Background

There's a desire to transition from podman to nerdctl on the Live CD, because it provides graceful apparmor support for rootless containers. The Live CD ISO image size should not get out of control though.

Objectives

yveszoundi commented 1 year ago

Nerdctl is a Docker compatible CLI for containerd. The concept of "snapshots" seems to be an integral part of how containerd works.

In order to create a container, the following must occur:

    The image and all its content must be loaded into the content store. This normally happens via download from the OCI registry, but you can load content in directly as well.
    Committed snapshots must be created from each layer of content for the image.
    An active snapshot must be created on top of the final layer of content for the image.

A container now can be created, with its root filesystem as the active snapshot.

Nerdctl directory layout

There are few interesting folders for Nerdctl "rootless" installations

Nerdctl snapshotters

There are several "snapshotters" that work with nerdctl including the native one, stargz, fuse-overlayfs, just to name a few. Apparently there's a gRPC contract implementation for using a given "snapshotter plugin".

Compressing image blobs

It is possible to compress images with nerdctl really well (slow process)

nerdctl image convert --estargz --oci <originalname> <newname>

Sadly, compressing images sadly doesn't address any disk storage concerns after removing the original uncompressed image.

The snapshot is still present and it's essentially a duplicate copy of the unpacked image contents. If using let's say the overlayfs snapshotter, we would have duplicated data in the snapshot folder.