mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 08:25:00 +00:00
Docker: fix sandbox cache mount continuations
This commit is contained in:
@@ -56,6 +56,32 @@ describe("docker build cache layout", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("does not leave empty shell continuation lines in sandbox-common", async () => {
|
||||
const dockerfile = await readRepoFile("Dockerfile.sandbox-common");
|
||||
expect(dockerfile).not.toContain("apt-get install -y --no-install-recommends ${PACKAGES} \\");
|
||||
expect(dockerfile).toContain(
|
||||
'RUN if [ "${INSTALL_PNPM}" = "1" ]; then npm install -g pnpm; fi',
|
||||
);
|
||||
});
|
||||
|
||||
it("does not leave blank lines after shell continuation markers", async () => {
|
||||
for (const path of [
|
||||
"Dockerfile.sandbox",
|
||||
"Dockerfile.sandbox-browser",
|
||||
"Dockerfile.sandbox-common",
|
||||
"scripts/docker/cleanup-smoke/Dockerfile",
|
||||
"scripts/docker/install-sh-smoke/Dockerfile",
|
||||
"scripts/docker/install-sh-e2e/Dockerfile",
|
||||
"scripts/docker/install-sh-nonroot/Dockerfile",
|
||||
]) {
|
||||
const dockerfile = await readRepoFile(path);
|
||||
expect(
|
||||
dockerfile,
|
||||
`${path} should not have blank lines after a trailing backslash`,
|
||||
).not.toMatch(/\\\n\s*\n/);
|
||||
}
|
||||
});
|
||||
|
||||
it("copies only install inputs before pnpm install in the e2e image", async () => {
|
||||
const dockerfile = await readRepoFile("scripts/e2e/Dockerfile");
|
||||
const installIndex = dockerfile.indexOf("pnpm install --frozen-lockfile");
|
||||
|
||||
Reference in New Issue
Block a user