Updated: 20 May 2023
Start a Node REPL session
docker run -it --rm --name my_node -v "$PWD":/usr/src/app -w /usr/src/app node:20
Run a JS script directly
docker run -it --rm --name my_node -v "$PWD":/usr/src/app -w /usr/src/app node:20 node the-script.js
Start a bash session
docker run -it --rm --name my_node -v "$PWD":/usr/src/app -w /usr/src/app node:20 /bin/bash
# then perhaps
npm install eslint --save-dev