fix(docker): COPY patches/ into deps stage so pnpm install can apply patchedDependencies #282

Closed
opened 2026-06-24 13:56:37 +00:00 by james · 0 comments
Owner

Symptom

After #279 merged, release.yml (run #710) failed in the deps Docker stage with:

#15 1.051  ENOENT  ENOENT: no such file or directory, open '/repo/patches/@react-native__gradle-plugin@0.85.3.patch'
#15 ERROR: process "/bin/sh -c pnpm install --frozen-lockfile --ignore-scripts  && CI=true pnpm rebuild" did not complete successfully: exit code: 254

Same failure surface in pr.yml's Trivy (image) job (run #705 job 10) and would also bite build-feature-image.yml — all three workflows do docker build against the root Dockerfile.

Root cause

Dockerfile lines 43-47 stage in just the manifests + lockfile before running pnpm install --frozen-lockfile. #279 added a pnpm.patchedDependencies entry pointing at patches/@react-native__gradle-plugin@0.85.3.patch. The Dockerfile doesn't COPY the patches/ directory before the install step, so pnpm can't find the patch file and bails. The dev-loop install + the host CI install both worked because they run with the full tree present.

Fix

Add COPY patches/ patches/ to the deps stage before pnpm install. One line, no other changes needed. The patches/ directory is small (one file today) and changes infrequently, so layer-cache busting on patch edits is fine.

Acceptance

  • release.yml build step succeeds against the patched lockfile.
  • pr.yml Trivy (image) job builds the image successfully.
  • build-feature-image.yml builds successfully.

Out of scope

Reorganising the Dockerfile to share the install step with the host CI install — that's a separate refactor (and folds into the broader "share android setup steps" follow-up #280).

## Symptom After #279 merged, `release.yml` (run [#710](https://forge.wynning.tech/james/carol/actions/runs/710)) failed in the `deps` Docker stage with: ``` #15 1.051 ENOENT ENOENT: no such file or directory, open '/repo/patches/@react-native__gradle-plugin@0.85.3.patch' #15 ERROR: process "/bin/sh -c pnpm install --frozen-lockfile --ignore-scripts && CI=true pnpm rebuild" did not complete successfully: exit code: 254 ``` Same failure surface in `pr.yml`'s Trivy (image) job (run [#705](https://forge.wynning.tech/james/carol/actions/runs/705) job 10) and would also bite `build-feature-image.yml` — all three workflows do `docker build` against the root `Dockerfile`. ## Root cause `Dockerfile` lines 43-47 stage in just the manifests + lockfile before running `pnpm install --frozen-lockfile`. #279 added a `pnpm.patchedDependencies` entry pointing at `patches/@react-native__gradle-plugin@0.85.3.patch`. The Dockerfile doesn't COPY the `patches/` directory before the install step, so pnpm can't find the patch file and bails. The dev-loop install + the host CI install both worked because they run with the full tree present. ## Fix Add `COPY patches/ patches/` to the deps stage before `pnpm install`. One line, no other changes needed. The `patches/` directory is small (one file today) and changes infrequently, so layer-cache busting on patch edits is fine. ## Acceptance - `release.yml` build step succeeds against the patched lockfile. - `pr.yml` Trivy (image) job builds the image successfully. - `build-feature-image.yml` builds successfully. ## Out of scope Reorganising the Dockerfile to share the install step with the host CI install — that's a separate refactor (and folds into the broader "share android setup steps" follow-up #280).
james closed this issue 2026-06-24 16:25:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/carol#282
No description provided.