Can I make use of other containers like debian or arch

In addition to running “docker” containers via podman, which can have other distros, you can even convince toolbox to use other distros too.

An awesome coworker of mine recently published a blog post where he details how he makes his own custom Silverblue-like desktop (with Sway instead of GNOME) — but also shares how he uses toolbox not just for Fedora development, but also Debian too:
https://piware.de/post/2020-12-13-ostree-sway/

Here’s the toolbox-specific part:

Also, I can now build and use toolboxes (i.e. “special” containers) for my Linux stuff in pretty much exactly the same way: build-devtoolbox for Fedora, and build-debian-toolbox for Debian or Ubuntu. I run these scripts once a week to rebuild the containers from scratch. When I want to do Fedora/cockpit development, I do toolbox enter -c devel (conveniently aliased to ts as in “toolbox shell”), and for Debian I can do toolbox enter -c sid.

[…]

Things like VMs or libvirt have worked well in standard containers for pretty much ever, but thanks to toolbox’es clever setup even graphical programs work just fine out of the box (for both Wayland and X.org). So whenever I want to try the latest GIMP, calibre, or need Geogebra or Google Chrome for a quick thing, they are just a dnf/apt/pip/tar install away, and don’t cause permanent clutter.

Note that in recent versions of toolbox, you can drop the -c when using enter (but not for all sub-commands), so if you use his Debian script (for example) or something quite like it, you can run toolbox enter sid afterward.

Also, if you copy the script and modify it to your liking, you can add (or remove) whatever packages you want installed. I do this, and whenever I install something I find I need, I add it to the script. This way, I can remove the container whenever I want and can do a fresh rebuild of it.

You can, of course, do upgrades inside the container too. That’s also fine. I usually just upgrade-in-place. But modifying the script means less work later on, when you do want to create a new container, or bump up the base version for a major release “upgrade”.

It also means you can copy the script to another computer and get a container exactly how you like it without extra work.


Edit: You can even use Martin’s Debian script for an Ubuntu container (without modifying it at all) like so:

./build-debian-toolbox 20.10 ubuntu

(Assuming you did a chmod +x build-debian-toolbox first, otherwise you’d need to do sh build-debian-toolbox 20.10 ubuntu.)
:grin:

Once you’re done with the script, to get back into the toolbox, just run:

toolbox enter 20.10

(It drops you into the toolbox by default on the first run. But it’s up to you to re-enter it later.)

You can even assign the toolbox enter command to a profile as your shell in GNOME Terminal (or other terminals) or alias it in your standard shell to something easier to remember. Or just hit ctrl-r in your shell to quickly find it again with a substring search.

As for Arch, openSUSE, or another distro — it’s likely easily possible, using Martin’s script as a starting point and make appropriate edits for where the distros are different (package installation, config files, etc.).

6 Likes