fix(docker): seed prod store before offline prune

This commit is contained in:
Peter Steinberger
2026-05-22 18:08:38 +01:00
parent 48bf0374c8
commit 6788aa1943
2 changed files with 23 additions and 3 deletions

View File

@@ -121,10 +121,10 @@ RUN pnpm_config_verify_deps_before_run=false pnpm qa:lab:build
FROM build AS runtime-assets
ARG OPENCLAW_EXTENSIONS
ARG OPENCLAW_BUNDLED_PLUGIN_DIR
# BuildKit cache mounts are not part of cached layers; seed prune-only
# tarballs in the same step that runs offline prune.
# BuildKit cache mounts are not part of cached layers; seed tarballs for the
# installed prod graph in the same step that runs offline prune.
RUN --mount=type=cache,id=openclaw-pnpm-store,target=/root/.local/share/pnpm/store,sharing=locked \
pnpm store add source-map@0.6.1 && \
pnpm list --prod --depth Infinity --json | node scripts/list-prod-store-packages.mjs | xargs -r pnpm store add && \
CI=true pnpm prune --prod \
--config.offline=true \
--config.supportedArchitectures.os=linux \

View File

@@ -0,0 +1,20 @@
import fs from "node:fs";
const roots = JSON.parse(fs.readFileSync(0, "utf8"));
const specs = new Set();
function visit(node) {
for (const dep of Object.values(node.dependencies ?? {})) {
const name = dep.from || dep.name;
if (name && dep.version && dep.resolved?.startsWith("https://registry.npmjs.org/")) {
specs.add(`${name}@${dep.version}`);
}
visit(dep);
}
}
for (const root of roots) {
visit(root);
}
process.stdout.write([...specs].sort().join("\n"));