-
-
Save guymers/445a9bc7ba546ff714261e1515c5308d to your computer and use it in GitHub Desktop.
bwrap
This file contains hidden or 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 | |
| # export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/config" | |
| # $ cat ~/.config/npm/config | |
| # prefix=${XDG_DATA_HOME}/npm | |
| # cache=${XDG_CACHE_HOME}/npm | |
| # init-module=${XDG_CONFIG_HOME}/npm/init.js | |
| # audit=false | |
| # fund=false | |
| # update-notifier=false | |
| exec bwrap \ | |
| --unshare-all --share-net \ | |
| --unshare-user \ | |
| --disable-userns \ | |
| --die-with-parent \ | |
| --new-session \ | |
| --clearenv \ | |
| --setenv PATH /usr/bin \ | |
| --setenv HOME "$HOME" \ | |
| --setenv XDG_CONFIG_HOME "$XDG_CONFIG_HOME" \ | |
| --setenv XDG_CACHE_HOME "$XDG_CACHE_HOME" \ | |
| --setenv XDG_DATA_HOME "$XDG_DATA_HOME" \ | |
| --setenv NPM_CONFIG_USERCONFIG "$NPM_CONFIG_USERCONFIG" \ | |
| --dev /dev \ | |
| --proc /proc \ | |
| --tmpfs /tmp \ | |
| --tmpfs /var \ | |
| --ro-bind /etc/ca-certificates /etc/ca-certificates \ | |
| --ro-bind /etc/resolv.conf /etc/resolv.conf \ | |
| --ro-bind /etc/ssl /etc/ssl \ | |
| --ro-bind /usr /usr \ | |
| --symlink /usr/bin /bin \ | |
| --symlink /usr/lib /lib \ | |
| --symlink /usr/lib64 /lib64 \ | |
| --bind "$PWD" "$PWD" \ | |
| --bind "$XDG_CONFIG_HOME/npm" "$XDG_CONFIG_HOME/npm" \ | |
| --bind-try "$XDG_CACHE_HOME/npm" "$XDG_CACHE_HOME/npm" \ | |
| --bind-try "$XDG_DATA_HOME/npm" "$XDG_DATA_HOME/npm" \ | |
| "/usr/bin/npm" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment