Last active
June 29, 2016 15:05
-
-
Save luispabon/7e515765ce86fea145a76c80036f5187 to your computer and use it in GitHub Desktop.
npm install / build using a docker container
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
#!/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