Toolbox: What does a container needs to be usable by toolbox?

Hello Fedora community.

I am trying to get used to develop in containers (I am using Silverblue) and have questions.

At the time I am using a container with toolbox create ..., then enter with toolbox enter ... and then I run a bash script for installing necessary content.

But I thought I could move the installation process into a Containerfile but not every container is usable by toolbox.
So here are my questions:

What are the main differences between a toolbox container and a “normal” Fedora container?

How does a minimal Containerfile have to look like, to be usable with toolbox?

How does a “good” Containerfile look like?

Can I use different distribution images with toolbox, even though they are not officially supported?

Thank you for your help.

have a look at tollbox’s containerfiles, eg.

to see how the f38 toolbox container image
registry.fedoraproject.org/fedora-toolbox:38
was built from the normal f38 container image
registry.fedoraproject.org/fedora:38

2 Likes

@awarda Thank you for your help.

I have taken the Contaienrfile and reduced it until it stopped working, so here is what is necessary:

Containerfile

FROM registry.fedoraproject.org/fedora:38

RUN dnf -y install bash-completion bc bzip2 diffutils dnf-plugins-core findutils flatpak-spawn fpaste git gnupg2 gnupg2-smime gvfs-client hostname iproute iputils whois keyutils krb5-libs less lsof man-db man-pages mesa-dri-drivers mesa-vulkan-drivers mtr nano-default-editor nss-mdns openssh-clients passwd pigz procps-ng rsync shadow-utils sudo tcpdump time traceroute tree unzip util-linux vte-profile vulkan-loader wget which words xorg-x11-xauth xz zip 
RUN dnf clean all

This works fine, but if I remove the dnf install ... toolbox enter ... fails with this message:

podman build --tag f38-x --file f38-x/Containerfile
# ...
toolbox create --image f38-x
# ...
toolbox enter f38-x
Error: failed to initialize container f38-x

So my Question remains: what are the packages, that are necessary for toolbox?

There is a toolbox-support meta-package that includes the minimal packages required for toolbox.

$ dnf rq --requires toolbox-support
passwd
shadow-utils
util-linux
vte-profile

There is also toolbox-experience which should be the same as the list of packages you currently have.

2 Likes

Thank you for your help.
I reduced the Containerfile to this:

FROM registry.fedoraproject.org/fedora:38
RUN dnf -y install passwd shadow-utils util-linux vte-profile

What also helped was this documentation: Distro support
I don’t know, how I overlooked it.

1 Like