codex-universal

May 2, 2026 ยท View on GitHub

codex-universal is a reference implementation of the base Docker image available in OpenAI Codex.

This repository is intended to help developers cutomize environments in Codex, by providing a similar image that can be pulled and run locally. This is not an identical environment but should help for debugging and development.

For more details on environment setup, see OpenAI Codex.

Usage

The Docker image is available at:

docker pull ghcr.io/openai/codex-universal:latest

This repository builds the image for both linux/amd64 and linux/arm64. However we only run the linux/amd64 version. Your installed Docker may support linux/amd64 emulation by passing the --platform linux/amd64 flag.

The arm64 image differs from the amd64 image in 2 ways:

  • OpenJDK 10 is not available on amd64
  • The arm64 image skips installing swift because of a current bug with mise

The below script shows how can you approximate the setup environment in Codex:

# 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:latest

codex-universal includes setup scripts that look for CODEX_ENV_* environment variables and configures the language version accordingly.

Configuring language runtimes

The following environment variables can be set to configure runtime installation. Note that a limited subset of versions are supported (indicated in the table below):

Environment variableDescriptionSupported versionsAdditional packages
CODEX_ENV_PYTHON_VERSIONPython version to install3.10, 3.11.12, 3.12, 3.13, 3.14.0pyenv, poetry, uv, ruff, black, mypy, pyright, isort
CODEX_ENV_NODE_VERSIONNode.js version to install18, 20, 22corepack, yarn, pnpm, npm
CODEX_ENV_RUST_VERSIONRust version to install1.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_VERSIONGo version to install1.22.12, 1.23.8, 1.24.3, 1.25.1
CODEX_ENV_SWIFT_VERSIONSwift version to install5.10, 6.1, 6.2
CODEX_ENV_RUBY_VERSIONRuby version to install3.2.3, 3.3.8, 3.4.4
CODEX_ENV_PHP_VERSIONPHP version to install8.4, 8.3, 8.2
CODEX_ENV_JAVA_VERSIONJDK version to install25, 24, 23, 22, 21, 17, 11

What's included

In addition to the packages specified in the table above, the following packages are also installed:

  • bun: 1.2.10
  • bazelisk / bazel
  • erlang: 27.1.2
  • elixir: 1.18.3

See Dockerfile for the full details of installed packages.

Contributing

See CONTRIBUTING.md.