Note
This document describes another use case for migrating/moving software from one container or system to another.
Container Compositor
It might look like this can be an unusual use case: move installed software elsewhere.
What is this?
Container Compositor is a a use-case to compose a container from already provisioned root filesystem.
Imagine, you have a fully provisioned root filesystem, which contains dnf or zypper or apt or whatever
other Package Manager. In this case, one can just do this:
zypper install ffmpeg <ENTER>
This will result installing:
ffmpegitselfadditional required software dependencies and libraries (around 180 Mb of stuff)
This is great, when you have RPM database and /usr/bin/zypper available. However, on your other minimal
container, which has only Busybox available and glibc, no Zypper or any other package manager is available.
In this case, you won’t be able to install ffmpeg onto your container “just like that”.
What you would do is this:
Provision a “regular” rootfs somewhere, such as using e.g.
debootstrapor specifying the option--rootfor Zypper etc.Have a minimal rootfs for your future OCI container, e.g. using dynamic Busybox (with
glibcaround).Install whatever you want, using packages, into the “regular” rootfs.
Move it in a stripped version to a minimal rootfs, which is your future OCI container.
So in a nutshell:
The “Container Compositor” feature allows to take
ffmpegand move it into atar.gzarchive with all required libraries and symlinks “as is”, placed in those directories where they belong, including required artifacts from other packages.
Think of “Mezzotint in reverse”: instead of deleting everything else and leaving the container, it will take what is needed into an archive. Later on, you can unpack it at root point inside your container FS.
Warning
This feature expects that you are moving yourt software around only within the same distribution!
Usage
The usage is identical to a typical Mezzotint use, except add --copy (or -c) option as a filename
for a future tar.gz archive. For example:
mezzotint --exe /usr/bin/ffmpeg -r /path/to/my/rootfs --copy=ffmpeg
This will grab everything that belongs to ffmpeg and place it into a ffmpeg.tar.gz archive, which
will be located in /tmp directory of your target rootfs*, in this case /path/to/my/rootfs/tmp/ffmpeg.tar.gz.
You can also use --dry-run (-t), profile and other features alltogether.