fix(ci): bound non-root NodeSource setup download (#108911)

This commit is contained in:
Alix-007
2026-07-16 19:08:47 +08:00
committed by GitHub
parent 0ca1d23517
commit f538addc66
2 changed files with 11 additions and 1 deletions
+4 -1
View File
@@ -28,7 +28,10 @@ RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cach
RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=openclaw-install-sh-nonroot-apt-lists,target=/var/lib/apt,sharing=locked \
set -eux; \
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -; \
installer="$(mktemp)"; \
curl -fsSL --connect-timeout 10 --max-time 120 -o "$installer" https://deb.nodesource.com/setup_24.x; \
bash "$installer"; \
rm -f "$installer"; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nodejs
RUN useradd -m -s /bin/bash app \
@@ -463,6 +463,13 @@ describe("test-install-sh-docker", () => {
expect(nonrootDockerfile).toContain("USER app");
expect(nonrootDockerfile).toContain("WORKDIR /home/app");
expect(nonrootDockerfile).toContain("NPM_CONFIG_UPDATE_NOTIFIER=false");
expect(nonrootDockerfile).toContain('installer="$(mktemp)"');
expect(nonrootDockerfile).toContain(
'curl -fsSL --connect-timeout 10 --max-time 120 -o "$installer" https://deb.nodesource.com/setup_24.x',
);
expect(nonrootDockerfile).toContain('bash "$installer"');
expect(nonrootDockerfile).toContain('rm -f "$installer"');
expect(nonrootDockerfile).not.toMatch(/curl[^\n]+\|\s*bash/u);
});
it("keeps shared install helpers parsing and verifying installed CLI versions", () => {