Skip to content

Instantly share code, notes, and snippets.

@nyaocat
Created March 11, 2019 13:12
Show Gist options
  • Save nyaocat/fda1f31ec0df6a08f67c8237e0892b84 to your computer and use it in GitHub Desktop.
Save nyaocat/fda1f31ec0df6a08f67c8237e0892b84 to your computer and use it in GitHub Desktop.
nodeをインストールしたくないので docker で代用する(下記ファイルを PATH の通る場所に node, npm, npx と名付けてそれぞれ保存すると使える)
#!/bin/bash
set -eu
mkdir -p $HOME/.config $HOME/.npm
docker run \
-it --rm \
--tmpfs "/tmp" \
-v "$PWD:$PWD" \
-v "$HOME/.config:$HOME/.config" \
-v "$HOME/.npm:$HOME/.npm" \
-w "$PWD" \
-u "$(id -u):$(id -g)" \
-v /etc/passwd:/etc/passwd:ro \
-h "$(hostname)" \
--net=host \
node:10.15.3 \
"$(basename $0)" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment