Created
March 1, 2019 14:14
-
-
Save chr5tphr/d884963256de827c9c2e64802dac82eb to your computer and use it in GitHub Desktop.
Bubblewrap semi 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="${BWROOT:-$PWD/base}" | |
env -i bwrap \ | |
--bind "$BWROOT" / \ | |
--unshare-user \ | |
--unshare-cgroup \ | |
--unshare-ipc \ | |
--unshare-pid \ | |
--unshare-uts \ | |
--hostname isol \ | |
--uid 1000 \ | |
--gid 1000 \ | |
--tmpfs /tmp \ | |
--proc /proc \ | |
--dev /dev \ | |
--tmpfs /run \ | |
--ro-bind /usr /usr \ | |
--ro-bind /bin /bin \ | |
--ro-bind /sbin /sbin \ | |
--ro-bind /lib /lib \ | |
--ro-bind /lib64 /lib64 \ | |
--ro-bind /etc /etc \ | |
--ro-bind /var /var \ | |
--ro-bind /opt /opt \ | |
--setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ | |
--setenv TERM 'screen' \ | |
--setenv COLORFGBG 'default;default' \ | |
--setenv COLORTERM 'yes' \ | |
"$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment