Skip to content

Instantly share code, notes, and snippets.

@luispabon
Last active June 29, 2016 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luispabon/7e515765ce86fea145a76c80036f5187 to your computer and use it in GitHub Desktop.
Save luispabon/7e515765ce86fea145a76c80036f5187 to your computer and use it in GitHub Desktop.
npm install / build using a docker container
#!/usr/bin/env bash
# The following runs latest node container providing with a writable .npm folder for npm cache, node_modules will be owned by the running user
# usage: run-docker-npm npm install
mkdir -p .npm
touch .babel.json
docker run \
-u $(id -u):$(id -g) \
-v "`pwd`:/workdir" \
-v "`pwd`/.npm:/.npm" \
-v "`pwd`/.babel.json:/.babel.json" \
-w /workdir \
node \
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment