Skip to content

chore(downloads): replace Docker alpine with slim#8784

Open
MikeMcC399 wants to merge 1 commit intonodejs:mainfrom
MikeMcC399:download-recommend-node-slim
Open

chore(downloads): replace Docker alpine with slim#8784
MikeMcC399 wants to merge 1 commit intonodejs:mainfrom
MikeMcC399:download-recommend-node-slim

Conversation

@MikeMcC399
Copy link
Copy Markdown
Contributor

@MikeMcC399 MikeMcC399 commented Mar 29, 2026

Description

Replace Docker alpine with slim displayed on https://nodejs.org/en/download

https://nodejs.org/en/download previously recommended an Alpine Docker image, for instance, selecting the LTS version on this page suggests:

docker pull node:24-alpine

On the Platform list Node.js classifies Linux musl platforms as "Experimental", including Alpine as an example. The Strategy classification states:

Test failures on experimental platforms do not block releases.

On the docker-node repo, workflows are set up such that the non-availability of musl builds does not block the release of Node.js Docker images for security releases. For non-security releases, the strategy is currently undefined (see nodejs/docker-node#2363). Typically, maintainers may manually release Debian-based Docker images if Alpine builds are significantly delayed.

This means that the "Experimental" status of the Alpine unofficial builds often causes their release to be delayed.

Replacement assessment

Alpine Docker images have typically been preferred and recommended due to their smaller size. Due to less content, the risk of vulnerabilities is also reduced. On Docker Hub, the image node:alpine for linux/amd64 lists with 56.99 MB compressed size.

node:slim, as a Debian alternative to Alpine Linux, built from the base image debian:*-slim, lists with 75.37 MB.

Debian images use glibc. The Docker image node:lts-slim is published with the following architectures, none of which are "Experimental":

Docker OS/architecture Node.js category
linux/amd64 Tier 1
linux/arm64/v8 Tier 1
linux/ppc64le Tier 2
linux/s390x Tier 2

The trade-off when moving from node:alpine to node:slim is the advantage of faster and more reliable availability of new releases (Tier 1 or 2), compared to the disadvantage of ~30% size increase. This is disregarding other basic difference between Alpine and Debian, where Alpine is considered more of a restricted run-time environment, and Debian more of a flexible development / build environment.

Validation

Go to https://nodejs.org/en/download and select using "Docker" for LTS release. Note the instructions:

# Docker has specific installation instructions for each operating system.
# Please refer to the official documentation at https://docker.com/get-started/

# Pull the Node.js Docker image:
docker pull node:24-slim

# Create a Node.js container and start a Shell session:
docker run -it --rm --entrypoint sh node:24-slim

# Verify the Node.js version:
node -v # Should print "v24.14.1".

# Verify npm version:
npm -v # Should print "11.11.0".

Copying-and-pasting the whole script in one go doesn't work correctly (not due to this PR).

Individually copying each command works fine:

$ docker pull node:24-slim
24-slim: Pulling from library/node
Digest: sha256:06e5c9f86bfa0aaa7163cf37a5eaa8805f16b9acb48e3f85645b09d459fc2a9f
Status: Image is up to date for node:24-slim
docker.io/library/node:24-slim
$ docker run -it --rm --entrypoint sh node:24-slim
# node -v # Should print "v24.14.1".
v24.14.1
# npm -v # Should print "11.11.0".
11.11.0
# exit

Related Issues

Addresses #8690

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • [na] I've covered new added functionality with unit tests if necessary.

@MikeMcC399 MikeMcC399 requested a review from a team as a code owner March 29, 2026 12:19
Copilot AI review requested due to automatic review settings March 29, 2026 12:19
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Mar 29, 2026 0:19am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Node.js “Docker” install snippet shown on the download page to recommend Debian-based *-slim images instead of Alpine (musl) images, aligning the website guidance with Node.js platform support tiers.

Changes:

  • Replace node:<major>-alpine recommendations with node:<major>-slim.
  • Remove the conditional logic that previously switched between alpine and slim based on major version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants