-
Notifications
You must be signed in to change notification settings - Fork 238
Description
Various commands like flatpak, podman, rpm-ostree etc. can't really be used inside an OCI container. Some of them, like podman, might have some limited use, but, by and large, people expect to run them directly on the host.
At the same time, we expect a good percentage of users of the command line interface to spend most of their time inside a toolbox container, and one of the goals of the Toolbox project is to reduce the cognitive burden of using mutable containers on locked-down and immutable host OSes like Silverblue. Commands like flatpak and rpm-ostree are important tools for interfacing with such OSes.
Therefore, it would be nice if we could provide a user experience that's better than having to switch back and forth between a host and toolbox shell, or having to prefix every command with things like flatpak-spawn --host.
The easiest option is to install aliases in the shell running inside the container. However, it doesn't give us things like manuals and shell completion.
Another option is to pre-install the flatpak, podman, rpm-ostree, etc. RPMs in the fedora-toolbox base images but remove all the code, leaving behind only the manuals and shell completion. Then the toolbox command can place the corresponding shims via bind mounts to forward the calls to the host when starting the toolbox containers.
This will ensure that the fedora-toolbox images don't get bigger with useless Go binaries, and the wrappers can be kept updated through the toolbox package on the host. One advantage of having explicit shims over aliases is that we can intercept those corner cases where command invocations can't be forwarded to the host. eg., they might involve a path that's not shared between the host and the container. Failing with a clear error message is better than an obscure failure or strange side-effects.
However, I don't know what will happen if one of these packages are updated inside the containers. Would they interfere with the bind mounted shims? It would be nice if we could trim the useless bits from those packages during or after updating the RPM.