assemble: add unshare-netns and unshare-ipc support

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
Luca Di Maio
2023-04-06 23:01:29 +02:00
parent 7d832de4a3
commit f66b12ca5a
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -43,6 +43,8 @@ pre_init_hooks=""
pull=""
root=""
volume=""
unshare_netns=""
unshare_ipc=""
# Cleanup tmpfiles on exit
trap 'rm -f ${tmpfile}' EXIT
@@ -238,6 +240,12 @@ run_distrobox() (
if [ -n "${entry}" ] && [ "${entry}" -eq 0 ]; then
result_command="${result_command} --no-entry"
fi
if [ -n "${unshare_netns}" ] && [ "${unshare_netns}" -eq 1 ]; then
result_command="${result_command} --unshare-netns"
fi
if [ -n "${unshare_ipc}" ] && [ "${unshare_ipc}" -eq 1 ]; then
result_command="${result_command} --unshare-ipc"
fi
if [ -n "${home}" ]; then
result_command="${result_command} --home $(sanitize_variable "${home}")"
fi
+2 -2
View File
@@ -496,12 +496,12 @@ generate_command() {
--security-opt label=disable
--user root:root"
if [ "${unshare_ipc}" -ne 0 ]; then
if [ "${unshare_ipc}" -eq 0 ]; then
result_command="${result_command}
--ipc host"
fi
if [ "${unshare_netns}" -ne 0 ]; then
if [ "${unshare_netns}" -eq 0 ]; then
result_command="${result_command}
--network host"
fi