Docker container with Ubuntu 24.04, Node.js, git, jq, and @openai/codex npm package.
The container attempts to save your saved in state in your host computer, while maintaining the conversation and state for the project locally. This means you need to create an empty .codex directory in your project folder to maintain the codex history.
docker build -t codex-cli .
# Please note the mkdir part first here. Adjust if you already have a .codex folder.
mkdir -p .codex && docker run --rm -it -w /home/ubuntu/workspace \
-v ~/.codex/auth.json:/host-auth.json \
-v ./.codex:/home/ubuntu/.codex \
-v $(pwd):/home/ubuntu/workspace \
--name=codex-cli codex-cli bashRuns as the ubuntu user in the container.