Picking a base image

The first decision to make is to pick a base image. Normally, we would choose a Linux distribution as our base image. For instance, we can pick Ubuntu as our base image:

FROM ubuntu:bionic

We use the bionic tag to specify the exact version of Ubuntu we want (18.04 Long Term Support (LTS)).

However, as it turns out, Node has its own official Docker image available on Docker Hub (hub.docker.com/_/node/). Therefore, we can use the Node Docker image as our base image instead.

To use the Node Docker image as the base image, replace our FROM instruction with FROM node:8:

FROM node:8

For local development, we have been using NVM to manage our Node versions. This is useful when working on multiple JavaScript projects because ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.