Use the official Node.js image as the base for your app Dockerfile to ensure consistent runtime across dev and production.
Use the Alpine variant to produce a much smaller final Docker image for faster deploys and a reduced attack surface.
Use Docker Compose with the official Node.js image to run your app alongside a database service.
Run a single JavaScript file directly with the Node.js image without writing a Dockerfile at all.
This repository is the official source for the Node.js Docker images that are published to Docker Hub. Node.js is a runtime that lets you run JavaScript code outside of a browser, commonly used to build web servers and other networked applications. Docker is a system for packaging an application and all its dependencies into a container so it runs the same way on any computer. The images here give developers a ready-to-use base that already has Node.js installed. To use one, you reference the image in your own Dockerfile and build your application on top of it. The most common starting point is a line like FROM node:24, which pulls in the full Debian-based image with the specified version of Node.js. Several image variants are available to suit different needs. The standard image is large and includes many common system packages, making it easy to install additional tools. The alpine variant is based on a minimal Linux distribution and produces much smaller final images, which is useful when keeping container size small matters. The slim variant is a middle ground: Debian-based but with non-essential packages removed. The repository also provides guidance on common setup patterns. For example, it shows how to write a Dockerfile for a typical Node.js app, how to use Docker Compose to run your app alongside other services, and how to run a single JavaScript file directly using the image without writing a Dockerfile at all. Best practices documentation in the repository covers topics like avoiding running containers as the root user, reducing image size, and handling signals correctly so containers shut down cleanly. The images are maintained by the Node.js community working group.
← nodejs on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.