This directory contains a Dockerfile plus a helper script to run Codex CLI in a container while mounting your local workspace and Codex settings.
- Builds a local image named
codex-cli. - Mounts your local
~/.codexinto the container at/root/.codex. - Mounts a local workspace into
/workspace. - Masks a sensitive subdirectory inside the workspace by mounting an empty
named volume over
/workspace/app/settings. - Installs
ca-certificatesand passes host proxy env vars through to the container (if present) to reduce TLS/proxy connectivity issues.
- Edit
run.shand setWORKDIR_HOSTto the directory you want to mount. - Run:
./run.shIf Codex streaming fails with errors like:
stream disconnected before completion: error sending request for url (...)
run this inside the container:
curl -I https://chatgpt.com/backend-api/codex/responsesYou should at least get an HTTP response (often 401/403 is fine for this
check). DNS/TLS/proxy failures here indicate a container network/trust issue.
Edit HIDE_SUBDIR in run.sh to a different container path you want hidden.
- This is intended for macOS with Docker Desktop.
- The container starts in
bashand leaves you in/workspace.