Skip to content

feat: install the latest standalone Codex in dev containers - #19

Merged
mjun0812 merged 7 commits into
mainfrom
feat/modernize-ai-config
Sep 2, 2026
Merged

feat: install the latest standalone Codex in dev containers#19
mjun0812 merged 7 commits into
mainfrom
feat/modernize-ai-config

Conversation

@mjun0812

@mjun0812mjun0812 commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Overview and Background

This PR modernizes the generated development container by installing the latest stable standalone Codex CLI and by letting Claude Code load the shared agent instructions. Root CI previously rendered the latest template tag instead of the pull request revision, so unreleased template changes were not exercised.

Related Issues

None.

Implementation Approach

Build from the official mcr.microsoft.com/devcontainers/base:ubuntu-24.04 image because Python remains managed by uv for the selected template version. Run the installer published with the latest OpenAI Codex release during image builds, storing the standalone package under /opt/codex and exposing codex through /usr/local/bin. This avoids retaining Node.js solely for Codex and removes the previous Codex version pin.

Install the required Ubuntu packages in the same Dockerfile instead of delegating them to a third-party Feature. Locked BuildKit cache mounts preserve apt metadata and downloaded packages across builds.

Replace the Claude symlink with a regular import file because Claude's instruction import syntax requires @AGENTS.md as file content.

Keep tool caches separate from host credentials. The uv cache uses a project-specific named volume, while the host .claude and .codex directories remain read-write bind mounts so their configuration and file-backed authentication can be reused without redundant nested file mounts.

Copier now receives --vcs-ref HEAD in root CI so the generated test project represents the revision under test rather than the latest release tag.

Sources:

Changes

  • Build generated development containers from the Ubuntu 24.04 Dev Containers base image.
  • Install the latest stable standalone Codex release through the official installer.
  • Install Ubuntu packages through the Dockerfile with locked apt cache mounts.
  • Remove the general Node Feature, the apt packages Feature, and the post-create npm installation.
  • Persist the uv cache in a named volume.
  • Share the host Claude and Codex directories without duplicate nested mounts.
  • Generate CLAUDE.md as a regular file importing AGENTS.md.
  • Render the current template revision during root CI.

Impact

Newly generated projects and projects applying this Copier update resolve the latest stable Codex CLI when the Codex installation layer is built. Codex can therefore change between uncached image builds without a template change. Ubuntu package installation no longer depends on the rocker-org Feature. Python selection remains controlled by uv, and the existing Claude Code feature remains unchanged. The generated container has read-write access to the host .claude and .codex directories, matching the existing credential-sharing behavior.

Validation Results

  • Built the Codex image on arm64 with the official installer, which resolved Codex 0.152.1.
  • Ran codex --version as the non-root vscode user and received codex-cli 0.152.1.
  • Built the complete Dev Container with all configured Features successfully.
  • Verified wget, git, jq, GCC, rg, and fdfind are available to the non-root user.
  • Verified the generated mount list contains one uv cache volume and one bind mount for each host credential directory, with no nested file mounts.
  • Verified the generated CLAUDE.md contains exactly @AGENTS.md and is not a symlink.
  • Verified the workflow with actionlint and checked the Git diff for whitespace errors.

- build from the Ubuntu 24.04 devcontainer base image
- verify and install the standalone Codex 0.121.0 release for amd64 and arm64
- import AGENTS.md from a regular CLAUDE.md file
- make Copier render HEAD instead of the latest release tag
- ensure pull request changes are included in generated project checks
@mjun0812mjun0812 added the enhancement New feature or request label Sep 1, 2026
@mjun0812mjun0812 self-assigned this Sep 1, 2026
- persist the uv cache in a dedicated named volume
- share Claude and Codex host directories without redundant nested mounts
Grant the vscode user write access before dependency synchronization.
Keep the persistent uv cache usable on first container creation.
Initialize the parent cache directory ownership before dependency synchronization.
Allow pre-commit to create its cache beside the mounted uv cache.
- replace pinned release assets with the official standalone installer
- resolve the latest stable Codex version during image builds
@mjun0812mjun0812 changed the title feat: install verified standalone Codex in dev containersfeat: install the latest standalone Codex in dev containersSep 2, 2026
- consolidate apt packages with the Codex installation layer
- cache apt metadata and packages with locked BuildKit mounts
- remove the redundant third-party apt packages Feature
@mjun0812
mjun0812 merged commit 03c2bcd into mainSep 2, 2026
6 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@mjun0812