mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-19 01:14:49 -05:00
assemble: add unshare-netns and unshare-ipc support
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user