Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,39 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"

### MISE (for Elixir/Erlang) ###

ARG ERLANG_VERSION=27.1.2
ARG ELIXIR_VERSION=1.18.3

ENV MISE_DATA_DIR=/root/.local/share/mise
ENV PATH=/root/.local/bin:$PATH

# Install mise, then Erlang dependencies and Erlang/Elixir
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
libtool \
libwxgtk3.2-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libpng-dev \
libssh-dev \
libncurses5-dev \
libodbc2 \
unixodbc-dev \
&& rm -rf /var/lib/apt/lists/* \
&& curl https://mise.run | sh \
&& echo 'eval "$(~/.local/bin/mise activate bash)"' >> /etc/profile

# Install Erlang and Elixir with mise in a bash shell
RUN bash -c 'eval "$(~/.local/bin/mise activate bash)" \
&& mise install erlang@${ERLANG_VERSION} \
&& mise use --global erlang@${ERLANG_VERSION} \
&& eval "$(~/.local/bin/mise activate bash)" \
&& mise install elixir@${ELIXIR_VERSION}-otp-27 \
&& mise use --global elixir@${ELIXIR_VERSION}-otp-27'

### SETUP SCRIPTS ###

COPY setup_universal.sh /opt/codex/setup_universal.sh
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ docker run --rm -it \
-e CODEX_ENV_RUST_VERSION=1.87.0 \
-e CODEX_ENV_GO_VERSION=1.23.8 \
-e CODEX_ENV_SWIFT_VERSION=6.1 \
-e CODEX_ENV_ERLANG_VERSION=27.1.2 \
-e CODEX_ENV_ELIXIR_VERSION=1.18.3 \
# Mount the current directory similar to how it would get cloned in.
-v $(pwd):/workspace/$(basename $(pwd)) -w /workspace/$(basename $(pwd)) \
ghcr.io/openai/codex-universal:latest
Expand All @@ -35,13 +37,15 @@ docker run --rm -it \

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 variable | Description | Supported versions | Additional packages |
| -------------------------- | -------------------------- | ------------------------------------------------ | -------------------------------------------------------------------- |
| `CODEX_ENV_PYTHON_VERSION` | Python version to install | `3.10`, `3.11.12`, `3.12`, `3.13` | `pyenv`, `poetry`, `uv`, `ruff`, `black`, `mypy`, `pyright`, `isort` |
| `CODEX_ENV_NODE_VERSION` | Node.js version to install | `18`, `20`, `22` | `corepack`, `yarn`, `pnpm`, `npm` |
| `CODEX_ENV_RUST_VERSION` | Rust version to install | `1.83.0`, `1.84.1`, `1.85.1`, `1.86.0`, `1.87.0` | |
| `CODEX_ENV_GO_VERSION` | Go version to install | `1.22.12`, `1.23.8`, `1.24.3` | |
| `CODEX_ENV_SWIFT_VERSION` | Swift version to install | `5.10`, `6.1` | |
| Environment variable | Description | Supported versions | Additional packages |
| --------------------------- | --------------------------- | ------------------------------------------------ | -------------------------------------------------------------------- |
| `CODEX_ENV_PYTHON_VERSION` | Python version to install | `3.10`, `3.11.12`, `3.12`, `3.13` | `pyenv`, `poetry`, `uv`, `ruff`, `black`, `mypy`, `pyright`, `isort` |
| `CODEX_ENV_NODE_VERSION` | Node.js version to install | `18`, `20`, `22` | `corepack`, `yarn`, `pnpm`, `npm` |
| `CODEX_ENV_RUST_VERSION` | Rust version to install | `1.83.0`, `1.84.1`, `1.85.1`, `1.86.0`, `1.87.0` | |
| `CODEX_ENV_GO_VERSION` | Go version to install | `1.22.12`, `1.23.8`, `1.24.3` | |
| `CODEX_ENV_SWIFT_VERSION` | Swift version to install | `5.10`, `6.1` | |
| `CODEX_ENV_ERLANG_VERSION` | Erlang version to install | Any version supported by mise (e.g., `27.1.2`, `26.2.5`) | `mise` version manager |
| `CODEX_ENV_ELIXIR_VERSION` | Elixir version to install | Any version supported by mise (e.g., `1.18.3`, `1.17.3`) | `mise` version manager, automatically matched with Erlang OTP |

## What's included

Expand Down
27 changes: 27 additions & 0 deletions setup_universal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CODEX_ENV_NODE_VERSION=${CODEX_ENV_NODE_VERSION:-}
CODEX_ENV_RUST_VERSION=${CODEX_ENV_RUST_VERSION:-}
CODEX_ENV_GO_VERSION=${CODEX_ENV_GO_VERSION:-}
CODEX_ENV_SWIFT_VERSION=${CODEX_ENV_SWIFT_VERSION:-}
CODEX_ENV_ERLANG_VERSION=${CODEX_ENV_ERLANG_VERSION:-}
CODEX_ENV_ELIXIR_VERSION=${CODEX_ENV_ELIXIR_VERSION:-}

echo "Configuring language runtimes..."

Expand Down Expand Up @@ -60,3 +62,28 @@ if [ -n "${CODEX_ENV_SWIFT_VERSION}" ]; then
swiftly install --use "${CODEX_ENV_SWIFT_VERSION}"
fi
fi

if [ -n "${CODEX_ENV_ERLANG_VERSION}" ]; then
# Activate mise for this shell session
eval "$(~/.local/bin/mise activate bash)"
current=$(mise current erlang 2>/dev/null || echo "none")
echo "# Erlang: ${CODEX_ENV_ERLANG_VERSION} (default: ${current})"
if [ "${current}" != "${CODEX_ENV_ERLANG_VERSION}" ]; then
mise install erlang@"${CODEX_ENV_ERLANG_VERSION}"
mise use --global erlang@"${CODEX_ENV_ERLANG_VERSION}"
fi
fi

if [ -n "${CODEX_ENV_ELIXIR_VERSION}" ]; then
# Activate mise for this shell session
eval "$(~/.local/bin/mise activate bash)"
current=$(mise current elixir 2>/dev/null | cut -d'-' -f1 || echo "none")
echo "# Elixir: ${CODEX_ENV_ELIXIR_VERSION} (default: ${current})"
if [ "${current}" != "${CODEX_ENV_ELIXIR_VERSION}" ]; then
# Determine OTP version for Elixir installation
erlang_version=$(mise current erlang 2>/dev/null || echo "27")
otp_version=$(echo "$erlang_version" | cut -d'.' -f1)
mise install elixir@"${CODEX_ENV_ELIXIR_VERSION}"-otp-"${otp_version}"
mise use --global elixir@"${CODEX_ENV_ELIXIR_VERSION}"-otp-"${otp_version}"
fi
fi