Last active
August 6, 2023 08:48
-
-
Save chr5tphr/bb48d742081cab207c3320be782b20cd to your computer and use it in GitHub Desktop.
Bubblewrap full isolation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BWROOT="${1:?"Root not specified!"}" | |
shift | |
env -i bwrap \ | |
--bind "$BWROOT" / \ | |
--unshare-user \ | |
--unshare-cgroup \ | |
--unshare-ipc \ | |
--unshare-pid \ | |
--unshare-uts \ | |
--uid 1000 \ | |
--gid 1000 \ | |
--setenv PATH "/usr/bin:/usr/local/bin" \ | |
--setenv TERM 'screen' \ | |
--setenv COLORFGBG 'default;default' \ | |
--setenv COLORTERM 'yes' \ | |
--hostname isol \ | |
--ro-bind /etc/resolv.conf /etc/resolv.conf \ | |
--tmpfs /tmp \ | |
--proc /proc \ | |
--dev /dev \ | |
"$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment