mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(docker): seed prod store before offline prune
This commit is contained in:
@@ -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 \
|
||||
|
||||
20
scripts/list-prod-store-packages.mjs
Normal file
20
scripts/list-prod-store-packages.mjs
Normal 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"));
|
||||
Reference in New Issue
Block a user