Skip to content

Fix docker build: copy pnpm patches/ and all workspace crates#3436

Open
rafaelfiguereod-stack wants to merge 1 commit into
BloopAI:mainfrom
rafaelfiguereod-stack:fix/dockerfile-build-deps
Open

Fix docker build: copy pnpm patches/ and all workspace crates#3436
rafaelfiguereod-stack wants to merge 1 commit into
BloopAI:mainfrom
rafaelfiguereod-stack:fix/dockerfile-build-deps

Conversation

@rafaelfiguereod-stack

Copy link
Copy Markdown

What

docker build . fails on a clean checkout of main for two independent, unrelated reasons in the Dockerfile. This fixes both so the image builds end to end.

1. pnpm install --frozen-lockfile can't find the patch

pnpm-workspace.yaml declares a patched dependency:

patchedDependencies:
  '@pierre/diffs@1.1.4': patches/@pierre__diffs@1.1.4.patch

…but the fe-builder stage copies the lockfile/manifests without patches/, so the install aborts:

 ENOENT  ENOENT: no such file or directory, open '/app/patches/@pierre__diffs@1.1.4.patch'
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @vibe/local-web build ...  exit code: 254

Fix: COPY patches/ patches/ before the install.

2. The per-crate COPY list is missing 7 workspace members

The builder stage copies crate manifests and sources one-by-one, but the list has drifted from Cargo.toml's [workspace] members. These members are never copied: relay-client, relay-types, client-info, remote-info, embedded-ssh, desktop-bridge, preview-proxy. So cargo build --locked fails immediately:

error: failed to load manifest for workspace member `/app/crates/relay-client`
  failed to read `/app/crates/relay-client/Cargo.toml`: No such file or directory

Fix: replace the enumerated COPY crates/<name>/… lines with a single COPY 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 intermediate cargo build between the two copy groups), so collapsing it has no caching downside, and .dockerignore already excludes target/ and node_modules/. If you'd rather keep the split, I'm happy to instead just add the seven missing crates to the existing lists.

Verified

  • Both failures reproduce on a clean main checkout.
  • cargo metadata --locked resolves the workspace with the change.
  • docker build . completes end-to-end and the resulting image boots — /health returns 200 and the web UI is served.

— Rafael (rafaelfiguereod-stack)

`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.
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