diff --git a/scripts/e2e/Dockerfile b/scripts/e2e/Dockerfile index 489ca5555db..322c43bc8f4 100644 --- a/scripts/e2e/Dockerfile +++ b/scripts/e2e/Dockerfile @@ -48,7 +48,7 @@ COPY --from=openclaw_package --chown=appuser:appuser openclaw-current.tgz /tmp/o RUN npm install -g --prefix /tmp/openclaw-prefix /tmp/openclaw-current.tgz --no-fund --no-audit \ && mkdir -p /app/node_modules \ && cp -a /tmp/openclaw-prefix/lib/node_modules/. /app/node_modules/ \ - && cp -a /tmp/openclaw-prefix/lib/node_modules/openclaw/. /app/ \ + && find /tmp/openclaw-prefix/lib/node_modules/openclaw -mindepth 1 -maxdepth 1 ! -name node_modules -exec cp -a {} /app/ \; \ && mkdir -p "$HOME/.local/bin" \ && ln -sf /app/openclaw.mjs "$HOME/.local/bin/openclaw" \ && rm -rf /app/node_modules/openclaw \ diff --git a/src/docker-build-cache.test.ts b/src/docker-build-cache.test.ts index 4b6f9c7bdb4..45fa524a770 100644 --- a/src/docker-build-cache.test.ts +++ b/src/docker-build-cache.test.ts @@ -116,6 +116,9 @@ describe("docker build cache layout", () => { expect(dockerfile).toContain( "cp -a /tmp/openclaw-prefix/lib/node_modules/. /app/node_modules/", ); + expect(dockerfile).toContain( + "find /tmp/openclaw-prefix/lib/node_modules/openclaw -mindepth 1 -maxdepth 1 ! -name node_modules", + ); expect(dockerfile).toContain("rm -rf /app/node_modules/openclaw"); expect(dockerfile).toContain("ln -sf /app /app/node_modules/openclaw"); });