fix(docker): keep prune store warmup before offline stage

This commit is contained in:
Peter Steinberger
2026-05-21 07:58:15 +01:00
parent 1c5fda115f
commit 1e8d9666b0
2 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -72,7 +72,8 @@ RUN --mount=type=cache,id=openclaw-pnpm-store,target=/root/.local/share/pnpm/sto
NODE_OPTIONS=--max-old-space-size=2048 pnpm install --frozen-lockfile \
--config.supportedArchitectures.os=linux \
--config.supportedArchitectures.cpu="$(node -p 'process.arch')" \
--config.supportedArchitectures.libc=glibc
--config.supportedArchitectures.libc=glibc && \
pnpm store add source-map@0.6.1
# pnpm v10+ may append peer-resolution hashes to virtual-store folder names; do not hardcode `.pnpm/...`
# paths. Matrix's native downloader can hit transient release CDN errors while
@@ -122,7 +123,6 @@ FROM build AS runtime-assets
ARG OPENCLAW_EXTENSIONS
ARG OPENCLAW_BUNDLED_PLUGIN_DIR
RUN --mount=type=cache,id=openclaw-pnpm-store,target=/root/.local/share/pnpm/store,sharing=locked \
pnpm store add source-map@0.6.1 && \
CI=true pnpm prune --prod \
--config.offline=true \
--config.supportedArchitectures.os=linux \
+7 -3
View File
@@ -91,10 +91,14 @@ describe("Dockerfile", () => {
it("uses the Docker target platform for pnpm install and prune", async () => {
const dockerfile = await readFile(dockerfilePath, "utf8");
const installIndex = dockerfile.indexOf("pnpm install --frozen-lockfile \\");
const storeAddIndex = dockerfile.indexOf("pnpm store add source-map@0.6.1");
const pruneIndex = dockerfile.indexOf("CI=true pnpm prune --prod \\");
expect(dockerfile).toContain("pnpm install --frozen-lockfile \\");
expect(dockerfile).toContain("pnpm store add source-map@0.6.1 && \\");
expect(dockerfile).toContain("CI=true pnpm prune --prod \\");
expect(installIndex).toBeGreaterThan(-1);
expect(storeAddIndex).toBeGreaterThan(installIndex);
expect(storeAddIndex).toBeLessThan(pruneIndex);
expect(pruneIndex).toBeGreaterThan(-1);
expect(dockerfile).toContain("--config.offline=true");
expect(dockerfile.split("--config.supportedArchitectures.os=linux").length - 1).toBe(2);
expect(