Skip to content

Instantly share code, notes, and snippets.

@mterzo
Created January 18, 2017 23:58
Show Gist options
  • Save mterzo/5aa9b2576ec3b0edbb5dc7535340d615 to your computer and use it in GitHub Desktop.
Save mterzo/5aa9b2576ec3b0edbb5dc7535340d615 to your computer and use it in GitHub Desktop.
Node env wrapper for docker
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