Skip to content

Instantly share code, notes, and snippets.

@PureKrome
Last active February 28, 2025 02:54
Show Gist options
  • Save PureKrome/8096305d806d7b037674c16f55f01c00 to your computer and use it in GitHub Desktop.
Save PureKrome/8096305d806d7b037674c16f55f01c00 to your computer and use it in GitHub Desktop.
Running NPM inside a docker container

How to run some Node code in Docker because you're smart and don't want to have evil Node installed on your PC.

NODE DOCKER VERSIONS: https://hub.docker.com/_/node


docker run --rm -it -v ${PWD}:/src/someProject --name npm-stuff node /bin/bash

or if you have a SPECIFIC version of node to use/try:

(this is using node version 20)

docker run --rm -it -v ${PWD}:/src/someProject --name npm-stuff node:20 /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment