feat(run_in_container): optionally mount `~/.codex` so Linux users keep configs & logs
Resolved 💬 1 comment Opened May 2, 2025 by braun-viathan Closed Aug 7, 2025
What problem does this solve?
- On Linux Codex runs inside
scripts/run_in_container.sh.
Inside the container Codex looks for configs at /home/node/.codex (instructions, approval presets, session logs).
Because the host $HOME/.codex is not bind‑mounted today, every container start loses those files — users cannot persist settings or share them between runs.
Proposed solution
- Add a conditional bind mount in
run_in_container.sh
``bash``
if [[ -e "$HOME/.codex" ]]; then
docker_flags+=("-v" "$HOME/.codex:/home/node/.codex:ro")
fi
No directory ⇒ no mount ⇒ zero breakage.
- Allow an override flag
--config PATHso power‑users can point to an alternative folder/file (future‑proof for dot‑file minimalists). ([GitHub][1]) - Keep the mount read‑only; the container already writes logs under
/home/node/.codex/log, which is safe. ([GitHub][2])
Why now?
- as the development of the rust version with stable sandbox features for all OS will run smooth this enhancement will unify the conainerized linux to the mac sandbox. As Users will also have a persitent config and session logs while running the TS version of codex in a container.
Acceptance criteria
run_in_container.shmounts$HOME/.codexwhen present.- Codex inside the container loads the user’s
config.jsonand shows the chosen approval mode in the banner. - Script behaves exactly as before when the directory is absent.
Checklist
- [x] implementation
- [x] passes
pnpm test && pnpm lint && pnpm typecheck - [x] Examples in run_in_container.sh “Linux sandbox” section updated
Happy to submit the accompanying PR once #783 lands. \:rocket:
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗