Node.js is a JavaScript running environment based on Chrome V8 engine and a development platform that allows JavaScript to run on the server side. Access Node Mirror Library address: https://hub.docker.com/_/node?tab=tags . You can view other versions of Node through Sort by. The default is the latest version. node:latest . ` <../wp-content/uploads/2019/11/docker-node1.png>` __ You can also find other versions you want in the drop-down list: ` <../wp-content/uploads/2019/11/docker-node2.png>` __ In addition, we can use the docker search node command to view the available versions: Here we pull the official image of the latest version: ` <../wp-content/uploads/2019/11/docker-node3.png>` __ Use the following command to see if node is installed ` <../wp-content/uploads/2019/11/docker-node4.png>` __ You can see in the figure above that we have installed the latest version (latest) of the node image. After the installation is complete, we can run the node container using the following command: Parameter description: –name node-test : container name. ` <../wp-content/uploads/2019/11/docker-node5.png>` __ Finally, go to check the node version that the container is running: ` <../wp-content/uploads/2019/11/docker-node6.png>` __ 2.21.1. 1. View the available Node versions ¶
$ docker search node
2.21.2. 2. Take the latest version of node image ¶
$ docker pull node:latest
2.21.3. 3. View the local image ¶
$ docker images
2.21.4. 4. Run the container ¶
$ docker run -itd --name node-test node
2.21.5. 5. Installation succeeded ¶
$ docker exec -it node-test /bin/bash
root@6c5d265c68a6:/# node -v