Created
January 18, 2017 23:58
-
-
Save mterzo/5aa9b2576ec3b0edbb5dc7535340d615 to your computer and use it in GitHub Desktop.
Node env wrapper for docker
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
npmenv(){ | |
if [ $# -gt 0 ]; then | |
ver=$1 | |
else | |
ver='4.2.2' | |
fi | |
name=$(echo $ver|awk '{sub(/\./, "-"); print}') | |
container="node:$ver" | |
docker run --hostname node$name -it -v ${PWD}:/src -w /src \ | |
${container} /bin/bash | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment