Skip to content

fix(docker): use --prefer-offline for pnpm install in frontend builds#39

Merged
hunzlahmalik merged 1 commit into
foss-mainfrom
fix/docker-pnpm-prefer-offline
May 20, 2026
Merged

fix(docker): use --prefer-offline for pnpm install in frontend builds#39
hunzlahmalik merged 1 commit into
foss-mainfrom
fix/docker-pnpm-prefer-offline

Conversation

@hunzlahmalik
Copy link
Copy Markdown

@hunzlahmalik hunzlahmalik commented May 20, 2026

Summary

  • Replace pnpm install --offline with --prefer-offline in the four frontend Dockerfiles (apps/web, apps/space, apps/admin, apps/live).
  • Fixes ERR_PNPM_NO_OFFLINE_TARBALL on cold BuildKit caches (e.g. after docker builder prune -af).

Why

The Dockerfiles do pnpm fetch (online) → pnpm install --offline (cache-only), sharing the same BuildKit pnpm-store cache mount. In theory fetch always repopulates a wiped cache, so --offline is safe. In practice, turbo prune --scope=<X> --docker can drop pnpm catalog: entries from the pruned pnpm-lock.yaml. With the catalogs section gone, pnpm fetch has nothing to resolve catalog: refs against and silently skips those packages (e.g. @atlaskit/[email protected] — referenced from apps/web/package.json and packages/ui/package.json via "catalog:"). A pre-warmed pnpm-store cache from prior builds masked the gap until a docker builder prune -af wiped it.

--prefer-offline keeps the cache benefit when warm and falls back to the registry on miss, so first/no-cache builds succeed without changing hot-path behavior.

Test plan

  • docker builder prune -af then build plane-web → succeeds without ERR_PNPM_NO_OFFLINE_TARBALL
  • Repeat for plane-space, plane-admin, plane-live
  • Warm-cache rebuild of plane-web doesn't trigger fresh network fetches for already-cached tarballs

🤖 Generated with Claude Code

`pnpm install --offline --frozen-lockfile` fails with
ERR_PNPM_NO_OFFLINE_TARBALL on cold BuildKit caches (e.g. after
`docker builder prune -af`). Root cause: `turbo prune --docker` can
drop pnpm catalog entries from the pruned lockfile, so `pnpm fetch`
silently skips catalog-resolved packages (e.g.
@atlaskit/[email protected]). A pre-warmed pnpm-store
cache from prior builds masks the gap until it's wiped.

--prefer-offline preserves cache locality when warm and falls back to
the registry on misses, so first/no-cache builds succeed.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@hunzlahmalik hunzlahmalik merged commit 7a989d1 into foss-main May 20, 2026
7 checks passed
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.

1 participant