Sign inSign up

chorrell/node-minimal

By chorrell

Updated about 4 hours ago

A minimal docker image with just Node.js

Image
Languages & frameworks
2

10K+

chorrell/node-minimal repository overview

docker-node-minimal

A minimal Docker image with just Node.js.

The image starts from scratch and contains only a fully static Node.js binary compiled from source with build.sh. There is no OS, shell, or package manager. Multi-arch manifests are published for linux/amd64 and linux/arm64.

Tags

Every published build is available from both registries with the following tags:

TagDescription
20.10.0Exact Node.js version
20Major version (latest release of that major)
currentAlways the latest daily build
latestMost recent release

Use the Docker Hub Image

This image is published to Docker Hub:

https://hub.docker.com/r/chorrell/node-minimal

To pull the latest node-minimal image:

docker pull chorrell/node-minimal:latest

To pull a specific version:

docker pull chorrell/node-minimal:20.10.0

Use the GitHub Container Image

This image is published to the GitHub Container Registry:

https://github.com/chorrell/docker-node-minimal/pkgs/container/node-minimal

To pull the latest node-minimal image:

docker pull ghcr.io/chorrell/node-minimal:latest

To pull a specific version:

docker pull ghcr.io/chorrell/node-minimal:20.10.0

Usage

The entrypoint is the Node.js binary itself, so arguments are passed straight to Node:

docker run --rm chorrell/node-minimal:latest -e "console.log('Hello from Node.js ' + process.version)"

To run a script, mount it into the container and pass its path:

docker run --rm -v "$PWD:/app" -w /app chorrell/node-minimal:latest app.js

Building from Source

Node.js is compiled from source as a fully static binary by build.sh, then copied into the scratch image by the Dockerfile:

./build.sh -n 20.10.0
cp node-src/out/Release/node node
docker build -t node-minimal .

See AGENTS.md for the full development guide and SETUP.md for local pre-commit hook setup.

Tag summary

Content type

Image

Digest

sha256:47bc5a30f

Size

36.2 MB

Last updated

about 4 hours ago

docker pull chorrell/node-minimal