core-agent-ide/.devcontainer
Michael Bolin 3794363cac
fix: include libcap-dev dependency when creating a devcontainer for building Codex (#13814)
I mainly use the devcontainer to be able to run `cargo clippy --tests`
locally for Linux.

We still need to make it possible to run clippy from Bazel so I don't
need to do this!
2026-03-06 16:21:14 -08:00
..
devcontainer.json chore: install an extension for TOML syntax highlighting in the devcontainer (#1650) 2025-07-22 10:58:09 -07:00
Dockerfile fix: include libcap-dev dependency when creating a devcontainer for building Codex (#13814) 2026-03-06 16:21:14 -08:00
README.md fix: support arm64 build for Linux (#1225) 2025-06-05 20:29:46 -07:00

Containerized Development

We provide the following options to facilitate Codex development in a container. This is particularly useful for verifying the Linux build when working on a macOS host.

Docker

To build the Docker image locally for x64 and then run it with the repo mounted under /workspace:

CODEX_DOCKER_IMAGE_NAME=codex-linux-dev
docker build --platform=linux/amd64 -t "$CODEX_DOCKER_IMAGE_NAME" ./.devcontainer
docker run --platform=linux/amd64 --rm -it -e CARGO_TARGET_DIR=/workspace/codex-rs/target-amd64 -v "$PWD":/workspace -w /workspace/codex-rs "$CODEX_DOCKER_IMAGE_NAME"

Note that /workspace/target will contain the binaries built for your host platform, so we include -e CARGO_TARGET_DIR=/workspace/codex-rs/target-amd64 in the docker run command so that the binaries built inside your container are written to a separate directory.

For arm64, specify --platform=linux/amd64 instead for both docker build and docker run.

Currently, the Dockerfile works for both x64 and arm64 Linux, though you need to run rustup target add x86_64-unknown-linux-musl yourself to install the musl toolchain for x64.

VS Code

VS Code recognizes the devcontainer.json file and gives you the option to develop Codex in a container. Currently, devcontainer.json builds and runs the arm64 flavor of the container.

From the integrated terminal in VS Code, you can build either flavor of the arm64 build (GNU or musl):

cargo build --target aarch64-unknown-linux-musl
cargo build --target aarch64-unknown-linux-gnu