fix: pin pnpm@10.30.2 in admin, live, space Dockerfiles#28
Conversation
…erfiles corepack enable without a version pinned causes corepack to resolve pnpm from the workspace packageManager field (11.x), which moved the global bin to $PNPM_HOME/bin — breaking pnpm add -g in each builder stage. Add `corepack prepare pnpm@10.30.2 --activate` to builder and installer stages in Dockerfile.admin, Dockerfile.live, and Dockerfile.space, matching the pattern already used in Dockerfile.web (PR #22). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hunzlahmalik
left a comment
There was a problem hiding this comment.
The fix mirrors PR #22 cleanly, but two things worth tightening before merge:
Inconsistency between the three Dockerfiles
The installer stage ends up using a different incantation in space vs. admin/live:
| installer stage | |
|---|---|
Dockerfile.admin:69 |
corepack prepare pnpm@10.30.2 --activate |
Dockerfile.live:36 |
corepack prepare pnpm@10.30.2 --activate |
Dockerfile.space:70 |
corepack enable pnpm |
By line 70 in space, package.json is present (COPY at L62-67), so corepack enable pnpm should resolve to 10.30.2 via the packageManager field — but that re-introduces dependence on the same field-resolution path whose absence caused this bug in the builder stage. Safer to use corepack prepare pnpm@10.30.2 --activate here too, for parity with the other two and defense-in-depth.
Separately, Dockerfile.space:10 changes corepack enable pnpm → corepack enable (drops the pnpm arg). Not wrong (it now matches Dockerfile.live:7), but it's an unrelated stylistic change folded into a behavioral fix — easier to review if you either revert it or call it out explicitly in the PR body.
Extract the pnpm version to an ARG
pnpm@10.30.2 is now hard-coded in 5 places across the 4 Dockerfiles plus package.json. A future bump means hunting them all down. Same pattern TURBO_VERSION already uses in Dockerfile.live / Dockerfile.web:
ARG PNPM_VERSION=10.30.2
RUN corepack prepare pnpm@${PNPM_VERSION} --activateNot blocking — just future-proofing.
Replace `corepack enable pnpm` with `corepack prepare pnpm@10.30.2 --activate` in the installer stage for parity with Dockerfile.admin and Dockerfile.live. Also restore explicit `corepack enable pnpm` in the base stage for clarity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Good catches, both addressed in the follow-up commit (704f5b5):
On the |
* fix: pin pnpm@10.30.2 via corepack prepare in admin, live, space Dockerfiles corepack enable without a version pinned causes corepack to resolve pnpm from the workspace packageManager field (11.x), which moved the global bin to $PNPM_HOME/bin — breaking pnpm add -g in each builder stage. Add `corepack prepare pnpm@10.30.2 --activate` to builder and installer stages in Dockerfile.admin, Dockerfile.live, and Dockerfile.space, matching the pattern already used in Dockerfile.web (PR #22). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(space): use corepack prepare to pin pnpm@10.30.2 in installer stage Replace `corepack enable pnpm` with `corepack prepare pnpm@10.30.2 --activate` in the installer stage for parity with Dockerfile.admin and Dockerfile.live. Also restore explicit `corepack enable pnpm` in the base stage for clarity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
corepack enable pnpm(no version) lets corepack resolve pnpm from the workspacepackageManagerfield, pulling down pnpm 11.x$PNPM_HOME/bininstead of$PNPM_HOME, breakingpnpm add -g turboin builder stagescorepack prepare pnpm@10.30.2 --activateto builder and installer stages inDockerfile.admin,Dockerfile.live, andDockerfile.space, matching the pattern already applied toDockerfile.webin PR fix: pin pnpm@10.30.2 in web Dockerfile builder stage #22Test plan
docker build -f apps/admin/Dockerfile.admin .completes without errordocker build -f apps/live/Dockerfile.live .completes without errordocker build -f apps/space/Dockerfile.space .completes without error🤖 Generated with Claude Code