Skip to content

fix(devcontainer): build the devcontainer image FROM devtools - #6472

Merged
dan-petty merged 9 commits into
mainfrom
fix/6414-devcontainer-from-devtools
Nov 20, 2026
Merged

dan-petty merged 9 commits into
mainfrom
fix/6414-devcontainer-from-devtools

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

The DevContainer Image job took 386 s on average, over the limit, because .devcontainer/Dockerfile downloaded each tool by hand and seven Features had copied pins. Now the Dockerfile builds FROM the devtools image at a digest, with a hashed venv and the project last. podman-in-podman replaces docker-in-docker, so the os-release rewrite goes and the image has no Docker CLI. GIT_CONFIG_* and DOCKER_HOST move to remoteEnv. The image actions run the Dev Containers CLI of devtools on the runner, not in a job container (devtools has no Buildx), and run no devops install-tools. Renovate groups the devtools image. Risk: docker is Podman, with two image stores.

Two Proof lines cannot hold yet: GHCR reuse of all layers but the project layer (#6470), and the ci.yml docker run steps with --tmpfs uid options under Podman (#6468). A person checks the image on the Podman host (#6471).

Closes #6414

Change: openspec/changes/archive/2026-11-19-6414-devcontainer-from-devtools/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/devcontainer The DevContainer, its image and its features labels Nov 19, 2026
@dan-petty

dan-petty commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner Author

Test record

Head before the push: rebased on origin/main at 2d7d89e.

Scoped checks (local, devcontainer)

  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures,actionlint,zizmor: all rows pass.
  • uv run devops ci test tests/commands/test_ci.py tests/core/test_third_party_telemetry.py tests/invariants/test_devcontainer_config.py tests/invariants/test_uv_malware_check.py: 143 passed.
  • uv run mypy src/devops_cli/config/constants.py: no issues.
  • renovate-config-validator --strict --no-global .github/renovate.json (image ghcr.io/renovatebot/renovate:44.239.2, the version of the cluster CronJob): validated as repo config.

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main)

failed on base: tests.commands.test_ci::test_the_release_attests_and_tags_only_the_devcontainer_digest_its_smoke_test_started (AssertionError: assert ([('release-p...ainer Image']) == ([('release-p...ainer Image']))
1 failed on base (1 failed and 136 passed in tests/commands/test_ci.py, tests/core/test_third_party_telemetry.py, tests/invariants/test_devcontainer_config.py; 0 errored).
These changed tests fail or error on base and prove the fix: tests.commands.test_ci::test_the_release_attests_and_tags_only_the_devcontainer_digest_its_smoke_test_started.

Full image build and start (local, Docker 29.9.3, BuildKit 0.34.2, no registry cache)

The steps of .github/actions/devcontainer-image ran with a docker-container builder (host network) and a local registry:3:

  • docker buildx build --target devcontainers-cli --output type=local: the Dev Containers CLI 0.90.0 of the devtools image, 131 s (the pull of the 1713 MiB devtools image into the empty builder).
  • devcontainer build --frozen-lockfile ... --output type=image,push-by-digest=true,name-canonical=true,push=true with --sbom=true --provenance=mode=max --metadata-file: exit 0, 361 s cold (venv 27 s, project 4 s, common-utils 47 s, podman-in-podman 20 s, SBOM 39 s, layer export 77 s). No SecretsUsedInArgOrEnv and no other build-check warning. A plain docker buildx build -f .devcontainer/Dockerfile . with # check=error=true also passes.
  • New layers on the devtools base: venv 307 MiB, project 11 MiB, common-utils 44 MiB, podman-in-podman 2 MiB (compressed).
  • devcontainer upgrade wrote devcontainer-lock.json (common-utils 2.7.1, podman-in-podman 1.0.0).

The steps of .github/actions/devcontainer-smoke ran against that digest and passed: devcontainer up ran the post-start check of the Feature (podman-in-podman: rootless Podman 5.8.6 for vscode. /var/run/docker.sock: rootful Podman 5.8.6.), then every check of the action.

Proof commands in that container, as vscode:

  • grep VERSION_CODENAME /etc/os-release: forky.
  • docker version: Client: Podman Engine. podman --url unix:///var/run/docker.sock version: Server: Podman Engine.
  • printenv DOCKER_HOST through devcontainer exec: unix:///var/run/docker.sock.
  • git config --get-all credential.https://github.com.helper: the empty value, then !gh auth git-credential.
  • podman run --rm quay.io/podman/hello and sudo podman run --rm quay.io/podman/hello: Hello Podman World.
  • kubectl version --client, helm version, minikube version, trivy --version, gh --version, openspec --version, semgrep --version: exit 0.
  • devops docker images (Docker SDK on the rootful socket): lists the rootful store.
  • docker run --rm --entrypoint id "$IMAGE" -u works. docker run ... --tmpfs /home/devops:uid=1000,gid=1000 ... (ci.yml image smoke steps) fails under rootless and rootful Podman: unknown mount option "uid=1000". These steps run on the GitHub-hosted runner with Docker; ci: run the image smoke steps under Podman as well as Docker #6468 tracks them.

Not proven here

Follow-ups filed

Steps after the merge

See item 7 of the Change list in #6414.

@dan-petty
dan-petty force-pushed the fix/6414-devcontainer-from-devtools branch from 9eef771 to d0e8c7d Compare November 19, 2026 23:03
@dan-petty

Copy link
Copy Markdown
Owner Author

Review of head 9eef771: how each item is handled

New head: d0e8c7d (two fix commits, then the archive commit, on the current main).

# Item Result
1 Two Proof lines cannot hold yet, and the PR body does not name them Fixed. The PR body keeps Closes #6414 and has one paragraph that names GHCR layer reuse (#6470), the --tmpfs uid options under Podman (#6468) and the person check (#6471). The Dockerfile comment now says that the project layer is the last layer of the file, and that the Features add their layers over it (#6470).
2 ci.yml:93 says that the devcontainer Dockerfile copies the actionlint image Fixed. The comment says that the gate skips its actionlint row, that the devcontainer gets actionlint from the devtools image (devtools mise.toml: github:kjanat/actionlint 1.17.1), and that Renovate moves each pin.
3 The knowledge base still names Docker/DinD, and docker.md gives a plain docker build of a file that ends at USER vscode Fixed. developer_workstations_and_devcontainers.md names the host engine (Podman or Docker) and Podman in Podman in the text, the toolchain list and the diagram. docker.md names Podman and no Docker CLI, and its example is the devcontainer build command of docs/DEVCONTAINER_USAGE.md.
4 The smoke step ran the CLI copy of the build action (docker cp nests into an existing directory) Fixed. The smoke step removes and writes $RUNNER_TEMP/devcontainer-smoke-cli and runs devcontainer.js from there, so it starts the image with the CLI of that image, as the spec says.
5 The build runs the CLI on the runner, not in a job container No code change, as the review says. The PR body now records it and gives the reason (no Docker CLI or Buildx in devtools).
6 The Dockerfile comment says that the venv holds the tiktoken encodings Fixed. The comment says that the venv stage writes them to /usr/local/share/tiktoken (TIKTOKEN_CACHE_DIR).
7 The test record copies item 7 of the issue Fixed. The test record comment now links item 7 of the Change list in #6414 and does not copy it.

Test record

  • Scoped checks: uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures passes (10 of 10).
  • Workflow checks: uv run devops ci --check --only actionlint,zizmor passes.
  • Tests: uv run devops ci test tests/commands/test_ci.py tests/ai/benchmark/test_kb_gold_set.py tests/invariants/test_devcontainer_config.py: 132 passed.
  • docker cp behavior (item 4), on a local image: a copy of /etc/apt to a directory that exists gives <dest>/apt; a copy to a new path gives <dest>/apt.conf.d, <dest>/auth.conf.d and the other content.
  • The rebase onto main changed none of the files of this PR, so the tests above stay valid.
  • CI on d0e8c7d: 25 of 26 checks pass, DevContainer Image included. Static Analysis fails only in its audit row: GHSA-qx49-fqc8-xw99 (mcp 1.29.0, score 7.5) in src/devops_cli/tools_lock/semgrep.txt has no entry in .osv-scanner-ignore.yaml. This PR does not touch that file, and the same check passed on main at 22:42 UTC, before the advisory reached the scan. The newest semgrep release (1.186.0, PyPI, read 2026-11-19) still pins mcp==1.29.0, so the rule "A Finding with No Fix" of SECURITY.md applies. Its entry and tracking issue go in a separate pull request.
  • The first body of this round had 1281 characters above Closes, over the limit of 1000. The body now has 885.

Fail-to-pass

None. No fix changes src behavior: the src edits are knowledge base text, and the other edits are a workflow step and comments. So no new test applies.

@dan-petty

Copy link
Copy Markdown
Owner Author

Second review of head d0e8c7d: how the blocking item is handled

# Item Result
1 Static Analysis fails in its audit row on GHSA-qx49-fqc8-xw99 (mcp 1.29.0 in src/devops_cli/tools_lock/semgrep.txt) Real, and not caused by this PR. Fixed at the source in a separate PR, as SECURITY.md "A Finding with No Fix" says: #6482 (closes #6481) adds one entry to .osv-scanner-ignore.yaml until 2026-11-22, and #6480 tracks the Semgrep bump that removes it. This branch does not change. After #6482 merges, this branch gets an update on main and a new CI run.

Proof (read 2026-11-19)

  • Check run 135948694190: ✗ fail [audit] with the row GHSA-qx49-fqc8-xw99 | 7.5 | PyPI | mcp | 1.29.0 | 1.30.0 | src/devops_cli/tools_lock/semgrep.txt. All other checks of d0e8c7d pass.
  • OSV: HIGH, published 2026-11-19 22:45 UTC, fixed in 1.30.0. PyPI: Semgrep 1.186.0 (2026-11-18) is the newest release and requires mcp==1.29.0.
  • uv run devops ci --check --only audit: fails on this branch with the same row, and passes on the branch of fix(deps): ignore GHSA-qx49-fqc8-xw99 of mcp 1.29.0 until 2026-11-22 #6482.

Fail-to-pass

None: this round changes no file of this PR.

dan-petty added a commit that referenced this pull request Nov 19, 2026
…6482)

GitHub published GHSA-qx49-fqc8-xw99 (HIGH, fixed in mcp 1.30.0) on
2026-11-19. `src/devops_cli/tools_lock/semgrep.txt` pins `mcp==1.29.0`,
so the audit row of Static Analysis fails on each new pull request (for
example #6472). No released Semgrep takes the fix: 1.186.0, the newest
release, requires `mcp==1.29.0`. As SECURITY.md "A Finding with No Fix"
says, `.osv-scanner-ignore.yaml` gets one entry for that advisory and
that file until 2026-11-22. #6480 tracks the bump and the removal of the
entry.

Closes #6481

Change: `openspec/changes/archive/2026-11-19-6481-ignore-mcp-qx49/`
Plan of #6414: the image builds FROM the devtools image by digest,
Podman takes the place of Docker, and the image actions take the Dev
Containers CLI from the devtools image.
.devcontainer/Dockerfile builds FROM the devtools image at a digest, with
a hashed venv in /opt/devops-cli/.venv and the project as the last layer.
The hand download stages, the tool venvs and the os-release rewrite go.
The image config keeps common-utils and adds podman-in-podman with
dockerCompat, and the GIT_CONFIG_* entries move to remoteEnv with
DOCKER_HOST. The pin-comparison test goes.
The build action exports the devcontainers-cli stage of the Dockerfile
and builds with that CLI, and the smoke action copies the CLI from the
image that it starts. Neither action runs devops install-tools, so the
uv steps of their jobs go. The smoke action checks devops from the venv,
the tools, Podman, the rootful API socket and the order of the
credential helpers. The tools_lock path filter goes.
One pull request moves each reference of ghcr.io/dan-petty/devtools.
The Python-minor custom manager of the devcontainer Dockerfile goes, and
the descriptions that named devcontainer copies change.
DEVCONTAINER_USAGE.md names the devtools base, Podman in place of
Docker-in-Docker, the two image stores, DOCKER_HOST, the inotify risk,
the devcontainer upgrade step after a Feature bump and the GIT_CONFIG_*
entries in remoteEnv. SDLC.md, the knowledge base, the Purpose of the
devcontainer-image-tools spec and a comment of constants.py follow.
The build action writes its Dev Containers CLI to $RUNNER_TEMP/devcontainers-cli on the same
runner, and docker cp copies into a directory that exists. So the smoke step ran the CLI of the
build action. Now it removes and writes $RUNNER_TEMP/devcontainer-smoke-cli, and it starts the
image with the CLI of that image, as the ci-devcontainer-image spec says.
…ledge base

- ci.yml: the devcontainer gets actionlint from the devtools image, not from a COPY of the
  CI image.
- Dockerfile: the venv stage writes the tiktoken encodings to /usr/local/share/tiktoken, and the
  Features add their layers over the project layer (#6470).
- Knowledge base: the host engine is Podman or Docker, the image has Podman and no Docker CLI,
  and the local build example is the devcontainer build command of docs/DEVCONTAINER_USAGE.md.
@dan-petty
dan-petty force-pushed the fix/6414-devcontainer-from-devtools branch from d0e8c7d to 13a5cd0 Compare November 19, 2026 23:47
@dan-petty
dan-petty marked this pull request as ready for review November 19, 2026 23:57
@dan-petty
dan-petty merged commit 58e7b0d into main Nov 20, 2026
26 checks passed
@dan-petty
dan-petty deleted the fix/6414-devcontainer-from-devtools branch November 20, 2026 00:03
dan-petty-release Bot added a commit that referenced this pull request Nov 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.182.1](v0.182.0...v0.182.1)
(2026-11-20)


### Bug Fixes

* **devcontainer:** build the devcontainer image FROM devtools
([#6472](#6472))
([58e7b0d](58e7b0d))
* **security:** scan each image with one Trivy action and SARIF
([#6488](#6488))
([26e2a99](26e2a99))

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/devcontainer The DevContainer, its image and its features type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(devcontainer): build the devcontainer image FROM devtools

1 participant