fix(docker): use built bundled plugins in runtime images (#62316)

Merged via squash.

Prepared head SHA: c2bbfef188
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Gustavo Madeira Santana
2026-04-07 02:18:24 -04:00
committed by GitHub
parent 9a66b9cd54
commit 7155aa9c15
3 changed files with 8 additions and 9 deletions

View File

@@ -7,6 +7,10 @@ import { BUNDLED_PLUGIN_ROOT_DIR } from "../test/helpers/bundled-plugin-paths.js
const repoRoot = resolve(fileURLToPath(new URL(".", import.meta.url)), "..");
const dockerfilePath = join(repoRoot, "Dockerfile");
function collapseDockerContinuations(dockerfile: string): string {
return dockerfile.replace(/\\\r?\n[ \t]*/g, " ");
}
describe("Dockerfile", () => {
it("uses shared multi-arch base image refs for all root Node stages", async () => {
const dockerfile = await readFile(dockerfilePath, "utf8");
@@ -50,12 +54,10 @@ describe("Dockerfile", () => {
);
});
it("pins bundled plugin discovery to copied source extensions in runtime images", async () => {
const dockerfile = await readFile(dockerfilePath, "utf8");
it("does not override bundled plugin discovery in runtime images", async () => {
const dockerfile = collapseDockerContinuations(await readFile(dockerfilePath, "utf8"));
expect(dockerfile).toContain(`ARG OPENCLAW_BUNDLED_PLUGIN_DIR=${BUNDLED_PLUGIN_ROOT_DIR}`);
expect(dockerfile).toContain(
"ENV OPENCLAW_BUNDLED_PLUGINS_DIR=/app/${OPENCLAW_BUNDLED_PLUGIN_DIR}",
);
expect(dockerfile).not.toMatch(/^\s*ENV\b[^\n]*\bOPENCLAW_BUNDLED_PLUGINS_DIR\b/m);
});
it("normalizes plugin and agent paths permissions in image layers", async () => {