minimized nodejs application using minidock (686Mb. to 45.6Mb.)

by c4lf4
GNU/Linux ◆ xterm-256color ◆ bash 1577 views

This asciinema describes the procedure of creating a minimal nodejs application and dockerizing it using the standard nodejs application (whose size is 676Mb., as of Feb. 2018). Then the container is minimized using minidock (https://github.com/grycap/minicon). The result is that the image will have a size of only 45.6Mb, which is even less than the nodejs:alpine image.

The asciicast content

  1. Creating a basic nodejs applications using express-generator.
  2. Building one image (minicon:ex2fat) that contains a server that serves the just created application.
  3. Testing the application (wget -q -O- http://localhost:10000)
  4. Minimizing the image using minidock: include –apt dependencies, force to include the application folder.
  5. Testing the application in the minimized container (wget -q -O- http://localhost:10001)
  6. Compare the size of the new image (45.6Mb). against the original size (686Mb).