Skip to content

build(docker): take pnpm from its official image instead of Corepack - #406

Merged
kodiakhq[bot] merged 1 commit into
mainfrom
fix/docker-pnpm-image
Nov 17, 2026
Merged

kodiakhq[bot] merged 1 commit into
mainfrom
fix/docker-pnpm-image

Conversation

@RedStar071

@RedStar071 RedStar071 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

No issue. The same change as wolfstar-project/staryl#175.

🧭 Context

Node 25 and later no longer ship Corepack. Both Dockerfiles install it from npm, then let it fetch the pnpm version of packageManager. Staryl did not, and its image builds failed for a day after the move to Node 26. This takes pnpm out of that chain here too.

📚 Description

In Dockerfile and projects/bot/Dockerfile, the Corepack block becomes:

COPY --from=ghcr.io/pnpm/pnpm:12.18.0-alpine /opt/pnpm /opt/pnpm
ENV PATH="/opt/pnpm:$PATH"
  • It is a standalone binary for Alpine, published for amd64 and arm64, pinned to packageManager ([email protected]).
  • Every user can run it, so the node user runs pnpm start with nothing to download. That was the job of COREPACK_HOME and its chmod, which go away.
  • The binary needs the dist/ folder next to it, so the whole /opt/pnpm folder is copied.

Built locally from the root Dockerfile, --target runner:

Image pnpm
Corepack (before) 3.09 GB 12.18.0
Official pnpm image (this PR) 3.01 GB 12.18.0

The image tag and packageManager must move together. Renovate may bump them in separate pull requests.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. AI open source policy.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Reviews (1) · Last reviewed commit: "build(docker): take pnpm from its offici..." · Reviewed by Greptile

Node 25 and later no longer ship Corepack, so both images installed it
from npm, then let it fetch pnpm. pnpm now comes from its official image:
a standalone binary pinned to the packageManager version, with no npm
install and nothing fetched when the node user runs pnpm start. Staryl
needed the same change after its builds broke on Node 26.
@coldtea-pr-lens

Copy link
Copy Markdown

Note

The title starts with build(docker):, so PR Lens left this pull request undrawn. Comment @pr-lens draw to draw it

github.comment.notice: false in .github/pr-lens.yml turns this note off

@RedStar071

Copy link
Copy Markdown
Member Author

🤖 Agent comment (Claude, via Wolfstar Agent Kit). Checked by hand, since CI does not run the image.

  • Built the root Dockerfile, --target runner, on linux/amd64 with Docker 29.3: success in 188 s.
  • In the image, with --network none, as the node user in projects/bot: pnpm --version answers 12.18.0, and pnpm start runs the script and the nested pnpm --filter wolfstar-database run migrate:deploy. It stops at the expected missing DATABASE_URL, with nothing downloaded.
  • Not checked: projects/bot/Dockerfile on its own (same change, same base stage), the arm64 build, and a start against a real database.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — both Dockerfiles, one commit.

  • Dockerfile and projects/bot/Dockerfile: the Corepack block (COREPACK_HOME, npm install --global corepack, corepack enable/install, chmod) is replaced by COPY --from=ghcr.io/pnpm/pnpm:12.18.0-alpine /opt/pnpm /opt/pnpm and ENV PATH="/opt/pnpm:$PATH".

The base is node:26-alpine, so the -alpine (musl) pnpm image is the right variant. The tag matches packageManager ([email protected]), so pnpm 12 has no reason to switch versions at start. The whole /opt/pnpm folder is copied, as the pnpm Docker docs advise. They symlink pnpm, pn, pnpx and pnx into /usr/local/bin. Putting /opt/pnpm on PATH reaches the same binary and works for the node user. The comment about keeping the tag and packageManager in step is a good guard against Renovate bumping them separately.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@github-project-automation github-project-automation Bot moved this from Todo to Review Approved in Wolfstar Nov 17, 2026
@kodiakhq
kodiakhq Bot merged commit 37ef480 into main Nov 17, 2026
22 of 25 checks passed
@kodiakhq
kodiakhq Bot deleted the fix/docker-pnpm-image branch November 17, 2026 16:33
@github-project-automation github-project-automation Bot moved this from Review Approved to Done in Wolfstar Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant