My response presumed a comfort with building container images from the Containerfile (or Dockerfile, they’re the same) format. I learned that from something called The Docker Book. Apparently that costs money now but I’m sure there are plenty of resources to learn about it for free. Now I use Podman instead Docker. Podman replicated the Docker API, so you can even do alias docker='podman'
and it will work perfectly. Learning Docker or Podman are basically the same thing, they just work differently under the hood.
When you run toolbox create
on Silverblue 36, it creates a container from an image. That image is created by this file: toolbox/Containerfile at main · containers/toolbox · GitHub. I think Fedora Kinoite uses the same image when you run toolbox create
. You can run toolbox list
to see what images and containers you are using.
To build my personal toolbox, I use a Containerfile that I wrote. It starts with the fedora-toolbox image and puts my stuff on top of it so I don’t have to manually install everything. I’m still getting set up on Silverblue so it’s pretty minimal.
# I keep this file at /var/home/myname/Toolbox/Containerfile
# Before Silverblue 36, this line said fedora-toolbox:35
FROM fedora-toolbox:36
# Update base packages
RUN sudo dnf -y upgrade
# Run trusted third-party installers
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Install RPM package groups
RUN sudo dnf -y group install \
"Development Tools" \
"C Development Tools and Libraries"
# Enable third-party repositories
RUN sudo dnf -y copr enable atim/nushell
RUN sudo dnf -y copr enable varlad/helix
# Install packages
RUN sudo dnf -y install \
bat \
fzf \
gnome-tweaks \
helix \
nushell
To use this file, we have to tell podman to build an image from it.
This script will build the container image using commands that are built into the Silverblue base system. Both the image and the container will be named after the user that runs the script.
# /var/home/myname/Toolbox/build.sh
podman build --tag $USER ~/Toolbox;
toolbox create --image $USER $USER;
If you run toolbox list
you’ll see you now have an image based on the Containerfile and a container based on that image. Running toolbox enter $USER
will put you in the container.
When you update the Containerfile, run this script to update the image, then create a new container from it, still named after the user.
# /var/home/myname/Toolbox/rebuild.sh
toolbox rm -f $USER;
podman rmi $USER;
sh ~/Toolbox/build.sh;
Then just run toolbox enter bob
(if your name is bob) and you’re in your toolbox, built from the file. Anything you want in your toolbox you just add to the file and rebuild. You can play around with new packages knowing that you’re able to rebuild from scratch. When Fedora 37 comes out I will use rpm-ostree rebase
to upgrade the OS then change the first line of my Containerfile to say FROM fedora-toolbox:37
. All of those dnf
commands in the Containerfile will then be running on the Fedora 37 operating system and will be installed accordingly, regardless of what base operating system I’m using. I could even start using Fedora 37 in the toolbox container before I upgrade Silverblue.
Hopefully this helps explain my workflow without too much confusion.