Pull the codex-universal Docker image
mainTo use the reference implementation of the OpenAI Codex environment locally, pull the latest image from the GitHub Container Registry (GHCR).
docker pull ghcr.io/openai/codex-universal:latestrepository·main·Indexed 21 days ago
https://github.com/openai/codex-universalA reference implementation of the Docker image used in OpenAI Codex, designed for developers to customize and debug environments locally. It supports configuring specific language runtimes for Python, Node.js, Rust, Go, Swift, Ruby, PHP, and Java via CODEX_ENV_* environment variables, and includes pre-installed packages such as bun, bazel, erlang, and elixir.
To use the reference implementation of the OpenAI Codex environment locally, pull the latest image from the GitHub Container Registry (GHCR).
docker pull ghcr.io/openai/codex-universal:latestYou can run the codex-universal image and approximate the OpenAI Codex setup environment by passing CODEX_ENV_* environment variables.
To ensure your local files are accessible within the container, the following pattern mounts your current working directory to /workspace/$(basename $(pwd)) and sets that as the working directory.
Note: The image is built for both linux/amd64 and linux/arm64, but the repository primarily runs the linux/amd64 version. If you are on an ARM-based machine, you may need to use the --platform linux/amd64 flag for emulation.
# See below for environment variable options.
# This script mounts the current directory similar to how it would get cloned in.
docker run --rm -it \
-e CODEX_ENV_PYTHON_VERSION=3.12 \
-e CODEX_ENV_NODE_VERSION=20 \
-e CODEX_ENV_RUST_VERSION=1.87.0 \
-e CODEX_ENV_GO_VERSION=1.23.8 \
-e CODEX_ENV_SWIFT_VERSION=6.2 \
-e CODEX_ENV_RUBY_VERSION=3.4.4 \
-e CODEX_ENV_PHP_VERSION=8.4 \
-v $(pwd):/workspace/$(basename $(pwd)) -w /workspace/$(basename $(pwd)) \
ghcr.io/openai/codex-universal:latestThe codex-universal image includes setup scripts that detect CODEX_ENV_* environment variables to install specific language versions and associated tools.
Supported Environment Variables and Versions:
| Environment variable | Description | Supported versions | Additional packages |
|---|---|---|---|
CODEX_ENV_PYTHON_VERSION | Python version | 3.10, 3.11.12, 3.12, 3.13, 3.14.0 | pyenv, poetry, uv, ruff, black, mypy, pyright, isort |
CODEX_ENV_NODE_VERSION | Node.js version | 18, 20, 22 | corepack, yarn, pnpm, npm |
CODEX_ENV_RUST_VERSION | Rust version | 1.83.0, 1.84.1, 1.85.1, 1.86.0, 1.87.0, 1.88.0, 1.89.0, 1.90, 1.91.1, 1.92.0, 1.93.0, 1.94.0, 1.95.0 | |
CODEX_ENV_GO_VERSION | Go version | 1.22.12, 1.23.8, 1.24.3, 1.25.1 | |
CODEX_ENV_SWIFT_VERSION | Swift version | 5.10, 6.1, 6.2 | |
CODEX_ENV_RUBY_VERSION | Ruby version | 3.2.3, 3.3.8, 3.4.4 | |
CODEX_ENV_PHP_VERSION | PHP version | 8.4, 8.3, 8.2 | |
CODEX_ENV_JAVA_VERSION | JDK version | 25, 24, 23, 22, 21, 17, 11 |
In addition to the language runtimes configured via environment variables, the following packages are pre-installed in the image:
bun: 1.2.10bazelisk / bazelerlang: 27.1.2elixir: 1.18.3