Skip to content

Update Docker examples #719

@NatoBoram

Description

@NatoBoram

As of Node.js 25, the example Dockerfiles at https://pnpm.io/docker are outdated.

 => ERROR [base 2/4] RUN corepack enable                                               0.7s
------
 > [base 2/4] RUN corepack enable:
0.305 /bin/sh: 1: corepack: not found
------
Dockerfile:4
--------------------
   2 |     ENV PNPM_HOME="/pnpm"
   3 |     ENV PATH="$PNPM_HOME:$PATH"
   4 | >>> RUN corepack enable
   5 |     COPY . /app
   6 |     WORKDIR /app
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c corepack enable" did not complete successfully: exit code: 127
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

In the changelogs at https://nodejs.org/en/blog/release/v25.0.0, we can see a bunch of entries about Corepack:

  • [f31c88021b] - (SEMVER-MAJOR) build: stop distributing Corepack (Antoine du Hamel) #57617
  • [22a864a275] - build: remove corepack from release tarballs (Jordan Harband) #59835
  • [86bfdb5528] - build: remove nocorepack vcbuild flag (Antoine du Hamel) #57772

From In a Docker container, the instructions should probably be updated to something like:

FROM node:25-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN apt update && apt install --yes wget && rm -rf /var/lib/apt/lists/*
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash -

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions