containers / composefs-rs

Rust library for the composefs filesystem
Apache License 2.0
7 stars 2 forks source link

Implement `cfsctl oci create-image` #6

Closed allisonkarlitskaya closed 1 month ago

allisonkarlitskaya commented 1 month ago

The biggest missing piece of the spike is the support for merging multiple oci layers into a single composefs image.

You can already do something like:

cfsctl oci ls-layer refs/layer/name |
    mkcomposefs --from-file - - |
    cfsctl import-image image/name

What's needed to get 'from here to there' is some sort of merging algorithm that gathers the oci::tar::get_entry() entries and puts them into a single table (taking whiteouts into account) before calling mkcomposefs on the result in storing everything back into the repository. That would probably be done as a function in src/oci/mod.rs and then exposed via a new oci subcommand on cfsctl.