fix(docker): use --prefer-offline for pnpm install in frontend builds#39
Merged
Merged
Conversation
`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/pragmatic-drag-and-drop@1.7.4). 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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm install --offlinewith--prefer-offlinein the four frontend Dockerfiles (apps/web,apps/space,apps/admin,apps/live).ERR_PNPM_NO_OFFLINE_TARBALLon cold BuildKit caches (e.g. afterdocker builder prune -af).Why
The Dockerfiles do
pnpm fetch(online) →pnpm install --offline(cache-only), sharing the same BuildKitpnpm-storecache mount. In theoryfetchalways repopulates a wiped cache, so--offlineis safe. In practice,turbo prune --scope=<X> --dockercan drop pnpmcatalog:entries from the prunedpnpm-lock.yaml. With the catalogs section gone,pnpm fetchhas nothing to resolvecatalog:refs against and silently skips those packages (e.g.@atlaskit/pragmatic-drag-and-drop@1.7.4— referenced fromapps/web/package.jsonandpackages/ui/package.jsonvia"catalog:"). A pre-warmedpnpm-storecache from prior builds masked the gap until adocker builder prune -afwiped it.--prefer-offlinekeeps 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 -afthen buildplane-web→ succeeds withoutERR_PNPM_NO_OFFLINE_TARBALLplane-space,plane-admin,plane-liveplane-webdoesn't trigger fresh network fetches for already-cached tarballs🤖 Generated with Claude Code