Codex
Run Codex in the container, sharing your host login and sessions.
Set up
Run codex login on the host first; it stores the login in ~/.codex/auth.json. Then use the files in examples/guides/codex:
~/.config/isodev/config.yaml
# yaml-language-server: $schema=https://isodev.dyszkiewicz.me/config.schema.json
# Codex with your host login and sessions.
image: isodev-codex:latest
build:
context: image
volumes:
# Login, configuration and sessions, shared with the host.
- type: bind
source: ~/.codex
target: /root/.codex
lifecycle:
on_exec:
# Alternative credentials, passed to commands when set on the host.
forward_env_vars: [OPENAI_API_KEY]~/.config/isodev/image/Dockerfile
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
# mise installs tools to ~/.local/share/mise and puts them on PATH through its
# shims. /usr/local/bin comes first, so files mounted there win.
ENV PATH=/root/.local/bin:/usr/local/sbin:/usr/local/bin:/root/.local/share/mise/shims:/usr/sbin:/usr/bin:/sbin:/bin
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl git \
&& rm -rf /var/lib/apt/lists/*
# mise, which installs the tools.
RUN curl -fsSL https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
# Codex.
RUN mise use --global codex
# The codex-acp adapter that Zed uses, with Node.js, whose binaries need
# libatomic1. Remove this step if you don't use Zed.
RUN apt-get update \
&& apt-get install -y --no-install-recommends libatomic1 \
&& rm -rf /var/lib/apt/lists/* \
&& mise use --global node@lts \
&& mise use --global npm:@agentclientprotocol/codex-acpBecause the whole ~/.codex directory is shared, token refreshes in a container also update the host. To use an API key instead, export OPENAI_API_KEY on the host.
Use it
isodev up --recreate
isodev exec codexWith Paseo, install the provider and choose Codex (Isodev). The provider runs Codex with approvals disabled and full access inside the container.
isodev int paseo install-provider --type=codex
paseo reload --jsonWith Zed, run isodev int zed install-provider --type=codex. Zed uses the codex-acp adapter from the last step of the Dockerfile.
Trade-offs
- The container can modify your Codex configuration. It can read and change everything in
~/.codex, including sessions andconfig.toml. Mount a separate directory with only a copy ofauth.jsonif you need stronger separation; token refreshes then stay in the container.
Last updated on