Repository navigation
refactor(docker): build the runner image FROM devtools with no tool install - #6513
Conversation
…nstall The runner image builds FROM ghcr.io/dan-petty/devtools by tag and digest, and the Dockerfile installs no tool: the gh download, the actionlint and runner-tools stages and each devops install-tools run go. The MCP server image builds on the Service image layers with kubectl and helm of devtools. The Service image takes gh and a pruned OpenSpec tree from devtools. The runner scan reports; the Service and MCP server scans keep the gate. Closes #4361
Proof of the images (local, Podman 5.8.6, 2026-11-20)Each command ran in a bash script under Build time and size
A change of
|
| Image | Rebuild | Layers | Changed layers |
|---|---|---|---|
| runner | 10 s | 15 | 1 (COPY --link of the project, 34.7 MB) |
| mcp-server | 24 s | 16 | 1 |
| service | 19 s | 15 | 1 |
The old Dockerfile ran the OpenSpec install-tools step and the runner_tools build step again on such a change. Note: Podman keys a RUN --mount=type=bind,from=lock on the image of the lock stage, so a change of the project version also rebuilt the two venv layers locally. BuildKit keys a read-only bind mount with a source path on the content of the file, as for the old COPY --from=lock, so CI keeps them. The first CI run after the merge shows this in the cache report of the Runner Image job.
Smoke steps (the steps of ci.yml, with --tmpfs /home/devops:mode=1777)
All exit 0:
- runner:
id -u= 1000;devops --version;python -m devops_cli.roadmap.runner_tools= "All 40 runner tools are on PATH and run."; the probe with--read-only --tmpfs /tmp --tmpfs /home/devops:mode=1777 --cap-drop ALL --security-opt no-new-privileges; no gcc;uv run --locked ruff --versionin a copy of the checkout on a read-only root (ruff 0.17.6, Python 3.14.10 of devtools). - mcp-server:
id -u= 1000;devops --version;kubectl version --client(v1.37.2);helm version(v4.3.2); size under 3,000,000,000. - service:
/healthzanswers; gh 2.105.0; git 2.47.3;openspec --version= 2.1.1 on the official Node binary; the probe; no uv, no gcc, no pytest.
Trivy 0.76.2 (flags of .github/actions/image-scan)
| Image | Exit code | Findings |
|---|---|---|
| mcp-server (gate, exit-code 1) | 0 | none (the 4 kubectl entries now name usr/local/bin/kubectl) |
| service (gate, exit-code 1) | 0 | none |
| runner (report, exit-code 0) | 0 | 282 HIGH, 4 CRITICAL in 15 devtools binaries (k9s, kube-linter, popeye, gitleaks, gh-dash, minikube, kubeconform, kubectl-argo-rollouts, tofu, golangci-lint, kustomize, argo, cloudflared, pluto, promtool) and 1 in the semgrep venv of devtools (mcp 1.29.0). None in /app/.venv. Scan time 46 s. |
git grep -n 'install-tools' -- Dockerfile prints nothing (exit 1).
Decisions for the owner to check
Overlap with open pull requests
After the merge
|
Name uv.lock as the source of the dev dependency versions in CLUSTER.md and runner_tools.py.
CI result on 65f5285All 29 checks pass, 7 skip. The Service and MCP Server scans gate with exit code 1 and find nothing. The Runner scan runs with exit code 0: it reports 282 HIGH and 4 CRITICAL findings in 15 devtools binaries and 1 in the semgrep venv of devtools, and it uploads the SARIF under Image job times
Both runs of this PR had no cache for the new stages, because the cache of main holds only the old stages. The steps of the Runner Image job:
The export and the scan of the larger image take most of the time, and the time of these two steps changes with the runner. A later cache from main saves only the venv steps (about 30 s). The two runs give a mean of 5:21, under the limit of 5 min + 1 min tolerance, but run 2 was over 6 min. #4649 measures the image jobs again after this change. If the mean of the Runner Image job goes over 6 min, that is a P0 under AGENTS.md rule 5. |
….lock The runner uses the devtools digest of .devcontainer/Dockerfile, which holds OpenSpec 2.1.0. The runner smoke test runs the OpenSpec gate in the image, and the OpenSpec pin moves in the Renovate devtools group. SECURITY.md states the real exposure of the Job pod and a review date, and the documents say that the runner follows the devtools image each week.
Owner decisions of 2026-11-20Recorded here and in the
Review findings: what changed
|
|
Superseded later on 2026-11-20. The owner direction: make no circular dependency with devtools image updates, and do not anticipate upstream changes. This PR therefore leaves the OpenSpec Renovate rule as main has it, and its runner smoke step no longer compares the OpenSpec of the image with
|
The runner smoke test no longer runs the OpenSpec gate in the image, so a devtools update does not need a move of tools.lock, and a move of tools.lock does not need a devtools update. The OpenSpec rule of Renovate is the rule of main again. The runner uses the OpenSpec of its devtools image, and the OpenSpec pin of the project reaches a runner Job through the coder bootstrap (#6517) after #6409. The documents and the change say so.
#6409 moves the OpenSpec pin from tools.lock to the project, so docs/CLUSTER.md and docs/SDLC.md name the pin of the project, as the Dockerfile and the design do.
🤖 I have created a release *beep* *boop* --- ## [0.183.0](v0.182.3...v0.183.0) (2026-11-20) ### Features * **research:** Map a pinned Action commit to its release ([#6490](#6490)) ([d27abc8](d27abc8)) ### Bug Fixes * **roadmap:** Name a dependency cycle in the roadmap jobs ([#6505](#6505)) ([494de4f](494de4f)) * **roadmap:** Read only blockers under Dependencies ([#6514](#6514)) ([59fc325](59fc325)) ### Code Refactoring * **docker:** build the runner image FROM devtools with no tool install ([#6513](#6513)) ([a165aaa](a165aaa)), closes [#4361](#4361) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
… the ADR (#3827) The runner image builds FROM the devtools image since #6513, and that image holds Gitleaks, Pluto, golangci-lint and Semgrep. So the scanners are RUNNER_TOOLS entries of the source DEVTOOLS and the Dockerfile gets no pin. ADR 0030 is taken, so the record is 0031. SECURITY.md states the runner exception.
The runner image builds FROM the devtools image of
.devcontainer/Dockerfile(tag and digest), which Renovate moves each week in thedevtoolsgroup. TheDockerfileinstalls no tool: the gh download, the actionlint andrunner-toolsstages and eachdevops install-toolsrun go. The MCP server image builds on the Service image layers with kubectl and helm of devtools. The Service image copies gh and an OpenSpec tree thatnpm prunecuts from devtools. The runner smoke test checks only thatopenspec --versionexits 0, so a devtools update does not wait fortools.lock. The project pin reaches a runner Job through #6517 after #6409. The runner scan reports with exit code 0, as SECURITY.md records; the Service and MCP server scans keep the gate. The runner size bound becomes 7000000000 bytes. Tests that read the removed Dockerfile lines go.Closes #4361
Change:
openspec/changes/archive/2026-11-20-4361-runner-from-devtools/