Fix docker build: copy pnpm patches/ and all workspace crates#3436
Open
rafaelfiguereod-stack wants to merge 1 commit into
Open
Fix docker build: copy pnpm patches/ and all workspace crates#3436rafaelfiguereod-stack wants to merge 1 commit into
rafaelfiguereod-stack wants to merge 1 commit into
Conversation
`docker build .` fails on a clean checkout of main for two independent reasons: 1. The fe-builder stage never copies `patches/`, but pnpm-workspace.yaml's patchedDependencies references patches/@pierre__diffs@1.1.4.patch, so `pnpm install --frozen-lockfile` aborts with ENOENT (pnpm exit 254). 2. The builder stage's hand-enumerated per-crate COPY list had drifted from Cargo.toml's [workspace] members -- relay-client, relay-types, client-info, remote-info, embedded-ssh, desktop-bridge and preview-proxy were never copied -- so `cargo build --locked` failed to load the workspace. Copy patches/ before the install, and replace the per-crate enumeration with a single recursive `COPY crates/ crates/` that cannot drift out of sync.
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.
What
docker build .fails on a clean checkout ofmainfor two independent, unrelated reasons in theDockerfile. This fixes both so the image builds end to end.1.
pnpm install --frozen-lockfilecan't find the patchpnpm-workspace.yamldeclares a patched dependency:…but the
fe-builderstage copies the lockfile/manifests withoutpatches/, so the install aborts:Fix:
COPY patches/ patches/before the install.2. The per-crate
COPYlist is missing 7 workspace membersThe
builderstage copies crate manifests and sources one-by-one, but the list has drifted fromCargo.toml's[workspace] members. These members are never copied:relay-client,relay-types,client-info,remote-info,embedded-ssh,desktop-bridge,preview-proxy. Socargo build --lockedfails immediately:Fix: replace the enumerated
COPY crates/<name>/…lines with a singleCOPY crates/ crates/, which can't drift out of sync with the workspace. The manifest-then-source split wasn't enabling dependency-layer caching here (there's no intermediatecargo buildbetween the two copy groups), so collapsing it has no caching downside, and.dockerignorealready excludestarget/andnode_modules/. If you'd rather keep the split, I'm happy to instead just add the seven missing crates to the existing lists.Verified
maincheckout.cargo metadata --lockedresolves the workspace with the change.docker build .completes end-to-end and the resulting image boots —/healthreturns 200 and the web UI is served.— Rafael (rafaelfiguereod-stack)