arrow_back
Back

Node.js Docker image: official Node runtime and versions

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

open_in_new node on Docker Hub .

Run a script using Node:

docker container run --rm \
    --interactive \
    --tty \
    --volume "$PWD:/usr/src/app" \
    --workdir /usr/src/app \
    --user $(id -u):$(id -g) \
    node:22 node app.js

Get version of NPM:

docker container run --rm \
    --interactive \
    --tty \
    --volume "$PWD:/usr/src/app" \
    --workdir /usr/src/app \
    --user $(id -u):$(id -g) \
    node:22 npm -v

Get version of Node:

docker container run --rm \
    --interactive \
    --tty \
    --volume "$PWD:/usr/src/app" \
    --workdir /usr/src/app \
    --user $(id -u):$(id -g) \
    node:22 node -v
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

PHP Docker image: official PHP-FPM, Apache, and CLI variants

arrow_forward