fix(docker): bound Docker GPG key download (#108894)

This commit is contained in:
Alix-007
2026-07-16 03:42:07 -07:00
committed by GitHub
parent 60987aa96d
commit 1ae12955f3
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -313,7 +313,8 @@ RUN --mount=type=cache,id=openclaw-bookworm-apt-cache,target=/var/cache/apt,shar
# Require exactly one primary key (`pub` in --with-colons; subkeys use `sub`) so we
# never pin the first fingerprint while apt trusts extra keys from the same file.
# Update OPENCLAW_DOCKER_GPG_FINGERPRINT when Docker rotates release keys.
curl -fsSL https://download.docker.com/linux/debian/gpg -o /tmp/docker.gpg.asc && \
curl -fsSL --connect-timeout 10 --max-time 120 \
https://download.docker.com/linux/debian/gpg -o /tmp/docker.gpg.asc && \
expected_fingerprint="$(printf '%s' "$OPENCLAW_DOCKER_GPG_FINGERPRINT" | tr '[:lower:]' '[:upper:]' | tr -d '[:space:]')" && \
docker_gpg_pub_count="$(gpg --batch --show-keys --with-colons /tmp/docker.gpg.asc | awk -F: '$1 == "pub" { c++ } END { print c+0 }')" && \
if [ "$docker_gpg_pub_count" != "1" ]; then \
+4 -1
View File
@@ -540,8 +540,11 @@ describe("Dockerfile", () => {
it("counts primary pub keys before Docker apt fingerprint compare and dearmor", async () => {
const dockerfile = collapseDockerContinuations(await readFile(dockerfilePath, "utf8"));
expect(dockerfile).toMatch(
/curl -fsSL --connect-timeout 10 --max-time 120\s+https:\/\/download\.docker\.com\/linux\/debian\/gpg -o \/tmp\/docker\.gpg\.asc/u,
);
const anchor = dockerfile.indexOf(
"curl -fsSL https://download.docker.com/linux/debian/gpg -o /tmp/docker.gpg.asc",
"https://download.docker.com/linux/debian/gpg -o /tmp/docker.gpg.asc",
);
expect(anchor).toBeGreaterThan(-1);
const slice = dockerfile.slice(anchor);