Merge branch 'BastilleBSD:master' into rdr-multiple-interfaces

This commit is contained in:
tschettervictor
2025-01-04 18:32:16 -07:00
committed by GitHub
14 changed files with 402 additions and 147 deletions

View File

@@ -6,11 +6,40 @@ To mount storage within the container use `bastille mount`.
.. code-block:: shell
ishmael ~ # bastille mount azkaban /storage/foo /media/foo nullfs ro 0 0
ishmael ~ # bastille mount azkaban /storage/foo media/foo nullfs ro 0 0
[azkaban]:
Added: /media/foo /usr/local/bastille/jails/azkaban/root/media/foo nullfs ro 0 0
ishmael ~ # bastille mount azkaban /storage/bar /media/bar nullfs ro 0 0
[azkaban]:
Added: /media/bar /usr/local/bastille/jails/azkaban/root/media/bar nullfs ro 0 0
Notice the JAIL_PATH format can be /media/foo or simply media/bar. The leading slash / is optional. The HOST_PATH howerver, must be the full path including the leading slash /.
It is also possible to mount individual files into a jail as seen below.
Bastille will not mount if a file is already present at the specified mount point.
If you do not specify a file name, bastille will mount the file underneath the specified directory as seen in the second example below.
.. code-block:: shell
ishmael ~ # bastille mount azkaban /etc/rc.conf /mnt/etc/rc.conf nullfs ro 0 0
[azkaban]:
Added: /etc/rc.conf /usr/local/bastille/jails/azkaban/root/mnt/etc/rc.conf nullfs ro 0 0
ishmael ~ # bastille mount azkaban /etc/rc.conf /media/bar nullfs ro 0 0
[azkaban]:
Added: /etc/rc.conf usr/local/bastille/jails/azkaban/root/media/bar/rc.conf nullfs ro 0 0
It is also possible (but not recommended) to have spaces in the directories that are mounted.
It is necessary to escape each space with a backslash \ and enclose the mount point in quotes "" as seen below.
It is possible to do the same for the jail path, but again, not recommemded.
.. code-block:: shell
ishmael ~ # bastille mount azkaban "/storage/my\ directory\ with\ spaces" /media/foo nullfs ro 0 0
[azkaban]:
Added: /storage/my\040directory\040with\040spaces /usr/local/bastille/jails/azkaban/root/media/foo nullfs ro 0 0
Syntax follows standard `/etc/fstab` format:
.. code-block:: shell
Usage: bastille mount TARGET host_path container_path [filesystem_type options dump pass_number]
Usage: bastille mount TARGET HOST_PATH JAIL_PATH [filesystem_type options dump pass_number]

View File

@@ -8,9 +8,21 @@ To unmount storage from a container use `bastille umount`.
ishmael ~ # bastille umount azkaban /media/foo
[azkaban]:
Unmounted: /usr/local/bastille/jails/jail4/root/media/foo
ishmael ~ # bastille umount azkaban /mnt/etc/rc.conf
[azkaban]:
Unmounted: /usr/local/bastille/jails/jail4/root/mnt/etc/rc.conf
Syntax requires only the container path to unmount:
Syntax requires only the jail path to unmount.
.. code-block:: shell
Usage: bastille umount TARGET container_path
Usage: bastille umount TARGET JAIL_PATH
If the directory you are unmounting has spaces, make sure to escape them with a backslash \, and enclode the mount point in quotes "".
.. code-block:: shell
ishmael ~ # bastille umount azkaban "/media/foo\ with\ spaces"
[azkaban]:
Unmounted: /usr/local/bastille/jails/jail4/root/media/foo with spaces