mkosi
mkosi copied to clipboard
OCI as output format
mkosi is a nice tool for building (in addition to other things) nspawn images. While nspawn can use a large number of different formats, OCI is a very convenient one since there is existing infrastructure for distribution (container registries). Should mkosi learn how to generate the on disk OCI format? Additionally, should mkosi be able to reuse existing directory trees from OCI images / layers as inputs? Not sure if this makes sense and if this belongs here (or should be implemented in systemd-repart instead).
If there's a tool that makes this easy and is packaged everywhere, we can support oci.
Currently the easiest workaround is likely to use a directory output and invoke buildah (or docker build with a dockerfile) to put it in a scratch image.
If there's a tool that makes this easy and is packaged everywhere, we can support oci.
skopeo-copy(1)
is widely packaged by distros and can do parts of it but it seems like the tar and a manifest.json still have to be created manually. So unless mkosi would be able to utilize some advantages of creating those images directly like multiple layers to have smaller diffs for upgrades I still stand by my statement that FROM scratch\nCOPY mkosi.output/...
is way simpler
isnt generating oci trivial? i.e. you just have to add some JSON to a tarball, and you are done?
Yes. You could use the generated sysroot as the only layer and create the necessary files to conform to this spec: https://github.com/opencontainers/image-spec/blob/main/image-layout.md
The result can either just be a plain directory or could be packaged as a tar.