Skip to content

Commit 0d8c0f9

Browse files
durandomclaude
andcommitted
fix: pin yarn@4.12.0 in image and chmod -R corepack cache
Two issues causing 10+ min yarn install retries in sandbox: 1. chmod 777 only set permissions on /tmp/corepack/ root, not the v1/ subdirectory tree created by corepack prepare as root. The sandbox user couldn't write to v1/ (needed for lastKnownGood.json). Fix: chmod -R 777. 2. yarn@stable installed 4.16.0, but rhdh-plugins pins yarn@4.12.0 in package.json. Corepack re-downloaded at runtime, wasting time and requiring network + write access. Fix: pin to 4.12.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ca90b48 commit 0d8c0f9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

images/code/Containerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ USER root
3131
# YARN_HTTP(S)_PROXY is set at runtime via env files, not baked in.
3232
ENV COREPACK_HOME=/tmp/corepack
3333

34+
# Pin yarn to the version rhdh-plugins uses (packageManager in package.json).
35+
# Using yarn@stable would install the latest (4.16.x), but the repo pins 4.12.0
36+
# and corepack would need to re-download at runtime — wasting time and requiring
37+
# write access to the cache.
38+
# chmod -R: v1/ subdirectory tree is created as root during prepare, but the
39+
# sandbox user needs write access (corepack updates lastKnownGood.json at runtime).
3440
RUN mkdir -p "$COREPACK_HOME" \
3541
&& corepack enable \
36-
&& corepack prepare yarn@stable --activate \
42+
&& corepack prepare yarn@4.12.0 --activate \
3743
&& yarn --version \
38-
&& chmod 777 "$COREPACK_HOME"
44+
&& chmod -R 777 "$COREPACK_HOME"
3945

4046
# ---------------------------------------------------------------------------
4147
# openspec CLI — spec-driven development tooling.

0 commit comments

Comments
 (0)