Sign inSign up

pagerinc/node

By pagerinc

•Updated over 7 years ago

Node JS on Docker

Image
0

4.2K

pagerinc/node repository overview

⁠pagerinc/node

CircleCI

Node.js on Docker.

⁠Overview

This image is based on the Alpine Linux variant of the official Nodejs image⁠. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

The main caveat to note is that it does use musl libc⁠ instead of glibc and friends⁠, so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See this Hacker News comment thread⁠ for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

To minimize image size, it's uncommon for additional related tools (such as git or bash) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the alpine image description⁠ for examples of how to install packages if you are unfamiliar).

⁠Installation and Usage

docker pull pagerinc/node
docker run -it --rm pagerinc/node node

⁠Available Tags

Currently, this node image comes in LTS flavor, tailored towards a specific use case.

  • 6.11, latest: Node.js v6.11.0

⁠Tests

Tests are run as part of the Dockerfile build. To execute them separately within a container, run:

bats test

⁠Features

⁠Environment Variables

NODE_ENV is already set to production for you. Any other secrets and runtime configuration need to be passed in to your application as well.

eg:

-e "NPM_CONFIG_LOGLEVEL=warn"
⁠Non-root User

By default, Docker runs container as root which inside of the container can pose as a security issue. You would want to run the container as an unprivileged user wherever possible. This image provides the unprivileged node user for such purpose.

⁠Init System

This image uses dumb-init⁠ as its entrypoint, dealing with issues such as PID 1 reaping problems⁠ for you, no configuration needed.

Tag summary

Content type

Image

Digest

Size

73.7 MB

Last updated

over 7 years ago

docker pull pagerinc/node