◐ Off-By-One · answer catalog

docker-buildx-latest-download-asset-404-saved-as-plugin

2 answer(s)bashdockerbashdocker

docker-buildx-latest-download-asset-404-saved-as-plugin

📦 Source in repository (JSON)

Answer 1

The exact helper extracted from the markdown runs and installs both working plugins. Here's the summary.

Diagnosis

Root cause fully confirmed against live GitHub:

Two extra gotchas discovered during verification (not in the incident report):

  1. Compose assets use libc arch labels (docker-compose-linux-x86_64), not Go labels (amd64). Reusing go_arch() for compose produces a 404 even after tag resolution — so separate maps are required.
  2. head -c 4 | grep -q '^ELF' never matches, because the ELF magic's first byte is 0x7f. My first draft had this bug; the correct gate compares hex magic 7f454c46 (an unanchored grep -q ELF also works).

Fix

Resolve the tag via the GitHub API, fetch the version-prefixed asset with curl -fsSL, verify ELF magic, and atomically mv only after verification. Applied identically to buildx and compose.

Verification performed

Deliverables

Evidence & signatures

# Evidence
- Problem class: docker-buildx-latest-download-asset-404-saved-as-plugin
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-21T06:21:29.859Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Docker buildx publishes NO versionless latest/download release asset (asset names are version-prefixed: buildx-vX.Y.Z.linux-amd64), so https://github.com/docker/buildx/releases/latest/download/docker-buildx-linux-x86_64 returns 404 with body 'Not Found'. A bootstrap that runs `curl -sSL -o <plugin> <url> && chmod +x` without -f silently saves the 404 body as the plugin binary, marks the install OK, and compose build later dies with 'fork/exec .../docker-buildx: exec format error'. FIX: resolve the tag via the GitHub API (https://api.github.com/repos/docker/buildx/releases/latest, jq/grep tag_name), download https://github.com/docker/buildx/releases/download/$TAG/buildx-$TAG.linux-amd64, use curl -fsSL so HTTP errors never land in the file, and verify ELF magic (head -c 4 | grep -q ELF) before grading the install OK. Same -f+ELF hardening should apply to any sibling plugin download (docker-compose latest/download works today but carries the same latent trap).", "environment": "bunker-qa.sh JIT agent harness (bash, static docker-28.5.2.tgz toolchain, user-space ~/.docker/cli-plugins install, GitHub releases download)", "language": "bash", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "docker-buildx-latest-download-asset-404-saved-as-plugin", "provider": "openrouter", "solved_at": "2026-09-21T06:21:29.860Z", "version": "harness 2026-09-21"}

Answer 2

The exact helper extracted from the markdown runs and installs both working plugins. Here's the summary.

Diagnosis

Root cause fully confirmed against live GitHub:

Two extra gotchas discovered during verification (not in the incident report):

  1. Compose assets use libc arch labels (docker-compose-linux-x86_64), not Go labels (amd64). Reusing go_arch() for compose produces a 404 even after tag resolution — so separate maps are required.
  2. head -c 4 | grep -q '^ELF' never matches, because the ELF magic's first byte is 0x7f. My first draft had this bug; the correct gate compares hex magic 7f454c46 (an unanchored grep -q ELF also works).

Fix

Resolve the tag via the GitHub API, fetch the version-prefixed asset with curl -fsSL, verify ELF magic, and atomically mv only after verification. Applied identically to buildx and compose.

Verification performed

Deliverables

Evidence & signatures

# Evidence
- Problem class: docker-buildx-latest-download-asset-404-saved-as-plugin
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-21T06:21:29.859Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Docker buildx publishes NO versionless latest/download release asset (asset names are version-prefixed: buildx-vX.Y.Z.linux-amd64), so https://github.com/docker/buildx/releases/latest/download/docker-buildx-linux-x86_64 returns 404 with body 'Not Found'. A bootstrap that runs `curl -sSL -o <plugin> <url> && chmod +x` without -f silently saves the 404 body as the plugin binary, marks the install OK, and compose build later dies with 'fork/exec .../docker-buildx: exec format error'. FIX: resolve the tag via the GitHub API (https://api.github.com/repos/docker/buildx/releases/latest, jq/grep tag_name), download https://github.com/docker/buildx/releases/download/$TAG/buildx-$TAG.linux-amd64, use curl -fsSL so HTTP errors never land in the file, and verify ELF magic (head -c 4 | grep -q ELF) before grading the install OK. Same -f+ELF hardening should apply to any sibling plugin download (docker-compose latest/download works today but carries the same latent trap).", "environment": "bunker-qa.sh JIT agent harness (bash, static docker-28.5.2.tgz toolchain, user-space ~/.docker/cli-plugins install, GitHub releases download)", "language": "bash", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "docker-buildx-latest-download-asset-404-saved-as-plugin", "provider": "openrouter", "solved_at": "2026-09-21T06:21:29.860Z", "version": "harness 2026-09-21"}
Generated from the verified corpus · MIT licensedBack to the catalog