While working on a project recently, I had to containerize a NodeJs Windows application. I was surprised to find that there was no single official image for the NodeJs Windows container on Docker Hub so I decided to create one. This process inspired me to put together a step by step guide on how to build a lightweight NodeJs Windows container using the Windows Nano Server. Please note that we chose to create this for a Windows Nano Server due to its optimized small size.

Pre-Requisites

  • Windows 10 or Windows 2016 server
  • Docker installed and switched to Windows containers
  • Hyper-V turned on to run Windows Containers

Setup

Create a folder labeled “docker-nodejs” on your hard disk.


Download NodeJs

Download the NodeJs ZIP (x64) package from the list of available versions on the following web-page:

NodeJs Versions

nodejs.org

For this example, I have chosen version v14.9.0

Image for post

Once the file has been downloaded, extract the content of the zip file into a folder. Rename the extracted folder “nodejs”. Move the nodejs folder inside the folder “docker-nodejs” (created in the first step).

#nodejs #docker #nano-server #nodejs-container #windows-containers

Lightweight Nodejs Windows Container (Nano Server)
3.80 GEEK