Last active
December 14, 2022 19:37
-
-
Save n0bodysec/07bde7e8946a2d933d1dfffa153d6b29 to your computer and use it in GitHub Desktop.
Node.js container alias
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
# without global modules | |
alias dn='docker run --rm -it -v $PWD:/app -w /app node' | |
# with global modules | |
docker run --rm -it -v $PWD:/app -v $HOME/.npm-global:/.npm-global -w /app -e NPM_CONFIG_PREFIX=/.npm-global -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/.npm-global/bin" node |
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
# without global modules | |
function dn { docker run --rm -it -v $pwd\:/app -w /app node $args } | |
# with global modules | |
function dn { docker run --rm -it -v $PWD\:/app -v $HOME\.npm-global:/.npm-global -w /app -e NPM_CONFIG_PREFIX=/.npm-global -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/.npm-global/bin" node $args } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment