I’ve been using Silverblue as my main driver for about two months now, lovin’ it.
I’ve also used Toolbox to setup some apps and packages that I couldn’t/didn’t want to with rpm-ostree. But I read somewhere that if I do an upgrade of my system I will lose the Toolbox container.
Is there a way to somehow retain/copy/transfer/backup my current toolbox? I read Toolbox’s documentation, but it has nothing on this.
The toolbox container should persist through upgrades; if that doesn’t happen it is a bug that needs to be investigated.
You may find yourself wanting to upgrade your toolbox container from F36 to F37 when the new Fedora release happens, in which case the state of your F36 toolbox container cannot be migrated automatically. (Hmm…maybe you could do something like dnf --releasever=37 upgrade, but that seems hacky)
I use toolbox for development and have a script that I update when I change the packages I care about inside my development container, so rebuilding is painless. I do dnf upgrade inside the container from time to time, but I rebuild it from scratch every few weeks.
(…However, I forgot to push my recent modifications. Whoops! I’ll have to do that when I’m back in working mode. But it hasn’t changed much, really, aside from the version bump.)
My script is quite a bit more complex than what you’re looking; most of it can be ripped out for a much simpler script.
Another colleague of mine builds her developer container in a different way (I should probably migrate to something like this):
GitHub - allisonkarlitskaya/lisbox: lis's developer toolbox, which can be built locally or even used directly like toolbox create -i quay.io/lis/box lisbox and that’s pretty neat (although this is specifically for Cockpit development, but the source repo could be pulled and built locally with modifications, of course)
You can go wild and have all sorts of scripts to build various toolbox containers too (more than just Fedora):
If you want to get a list of packages you currently have manually installed within a toolbox, run:
dnf repoquery --userinstalled --qf "%{name}"
It errors on the side of showing a few too many, so you might want to remove a few packages you don’t recognize or ones you know you didn’t install manually.
Edit packages.txt
(This step is optional; if you don’t edit it, it’ll still include packages that were installed and might be installed by default… you’ll wind up with a very similar package set to your old container.)
In your new container:
sudo dnf install $(cat packages.txt)
This method will let you skip using scripts and effectively build a new container with the same packages with just 2 commands (one in each container).