fix(docker): materialize ai runtime package

This commit is contained in:
Vincent Koc 2026-07-05 13:04:32 +02:00
parent 824d8af0d6
commit 57ca1b0254
No known key found for this signature in database
2 changed files with 10 additions and 0 deletions

View file

@ -153,6 +153,14 @@ RUN --mount=type=cache,id=openclaw-pnpm-store,target=/root/.local/share/pnpm/sto
OPENCLAW_EXTENSIONS="$OPENCLAW_EXTENSIONS" OPENCLAW_BUNDLED_PLUGIN_DIR="$OPENCLAW_BUNDLED_PLUGIN_DIR" node scripts/prune-docker-plugin-dist.mjs && \
node scripts/postinstall-bundled-plugins.mjs && \
find dist -type f \( -name '*.d.ts' -o -name '*.d.mts' -o -name '*.d.cts' -o -name '*.map' \) -delete && \
if [ -L /app/node_modules/@openclaw/ai ]; then \
ai_runtime_target="$(readlink -f /app/node_modules/@openclaw/ai)" && \
ai_runtime_tmp="$(mktemp -d)" && \
cp -a "$ai_runtime_target" "$ai_runtime_tmp/ai" && \
rm /app/node_modules/@openclaw/ai && \
mv "$ai_runtime_tmp/ai" /app/node_modules/@openclaw/ai && \
rmdir "$ai_runtime_tmp"; \
fi && \
rm -rf \
/app/node_modules/openclaw \
/app/node_modules/.bin/openclaw \

View file

@ -256,6 +256,8 @@ describe("Dockerfile", () => {
expect(dockerfile).toContain(
'OPENCLAW_EXTENSIONS="$OPENCLAW_EXTENSIONS" OPENCLAW_BUNDLED_PLUGIN_DIR="$OPENCLAW_BUNDLED_PLUGIN_DIR" node scripts/prune-docker-plugin-dist.mjs',
);
expect(dockerfile).toContain("readlink -f /app/node_modules/@openclaw/ai");
expect(dockerfile).toContain('mv "$ai_runtime_tmp/ai" /app/node_modules/@openclaw/ai');
expect(dockerfile).toContain("CI=true pnpm prune --prod \\");
expect(dockerfile.indexOf("CI=true pnpm prune --prod \\")).toBeLessThan(
dockerfile.indexOf(