How to bind-mount additional directories in Toolbox?

In my home, the ~/development folder is a link to /srv/data/develop (for multiple reasons)

It does not play well with Toolbox as /srv/... does not exist in the container. (/usr/local or /var/local would not help either because the goal is exactly to protect these folder from modification)

Is there a way to tell toolbox to mount /srv/.. ??

As far as I know this is not possible yet, see this PR https://github.com/containers/toolbox/pull/100.

You could probably create your own image, based on this https://github.com/containers/toolbox/blob/master/images/fedora/f32/Dockerfile, with custom mount points.

2 Likes

Create my own image, you mean modifying /usr/bin/toolbox script directly?
Adding a line at about 11000 like --volume /srv/data:/srv/data \ ??

That seems risky, no?

Sorry I had pasted the wrong link (updated original post now). I mean modifying this: https://github.com/containers/toolbox/blob/master/images/fedora/f32/Dockerfile

Some examples are here: https://gitlab.com/bkhl/toolboxes

2 Likes