From 8a7d09d32d58b24e0f1ae1fc05b61efcd6c0e8ff Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 22 Oct 2026 19:02:13 +0000 Subject: [PATCH] fix(templates): keep Corepack's Yarn in the Node runtime image Corepack cached Yarn under root's $HOME at build time, but the runtime image runs with HOME=/tmp, so a `yarn ...` CMD re-downloaded Yarn on every pod start and failed without network. Set COREPACK_HOME in the runtime stage so the download made during `yarn workspaces focus` is baked into the image. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe --- templates/Dockerfile.node | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/Dockerfile.node b/templates/Dockerfile.node index befd569..b967f5e 100644 --- a/templates/Dockerfile.node +++ b/templates/Dockerfile.node @@ -19,6 +19,10 @@ RUN yarn build FROM node:22-alpine WORKDIR /app +# Keep Corepack's Yarn download in the image (world-readable) rather than in +# root's $HOME, so a `yarn ...` CMD starts as uid 1000 without fetching Yarn +# from repo.yarnpkg.com on every pod start. +ENV COREPACK_HOME=/usr/local/share/corepack # tzdata is only needed if the app sets TZ. Add `git` here if the app shells # out to it. RUN apk add --no-cache tzdata \