A drop-in replacement to `npm install` on OS X using Docker
10K+
A drop-in replacement to npm install on OS X using Docker
Brings down and builds npm dependencies in the context of a Linux kernel and build environment. This is a useful if you develop on OS X, but want to use the exact same npm dependencies that will be used in production (Linux).
docker pull imichael/npm-linux
You can use this in any directory that has a package.json file in it. Just run:
docker run -it -v "$PWD:/src" -it imichael/npm-linux
If you have npm modules that are in private git repos, you can also do:
docker run -it \
-v "$PWD:/src" \
-v "$HOME/.ssh/id_rsa:/root/.ssh/id_rsa" \
imichael/npm-linux
The above command mounts your ssh key into the container while it's being ran so that npm can use it. Both commands will grab all
modules and build in Linux then save to node_modules/ in the current directory of your host operating system (OS X).
docker pull imichael/npm-linux:latest
All code for this container is here.
Content type
Image
Digest
sha256:90e1b9db3…
Size
246.8 MB
Last updated
about 11 years ago
docker pull imichael/npm-linux