Skip to content

Persist Codex login across container rebuilds - #76

Merged
AndreasBur merged 1 commit into
masterfrom
fix/persist-codex-login
Aug 25, 2026
Merged

Persist Codex login across container rebuilds#76
AndreasBur merged 1 commit into
masterfrom
fix/persist-codex-login

Conversation

@AndreasBur

Copy link
Copy Markdown
Owner

Opened for the branch as it stands, from 2026-08-23. It merges cleanly into master.

What it does

The Codex login lived in the container's home directory and was gone after every rebuild, so
it had to be entered again by hand. Both committed variants mount a named wordclock-codex
volume at /home/vscode/.codex, and the Dockerfile creates that path as the remote user at
mode 0700 first — an empty named volume takes its ownership from the path it covers, which is
the same reason ~/.platformio is seeded a few lines above.

It also drops the sentence in .devcontainer/README.md that said credentials belong in a
local variant rather than a committed one, since this puts one in the committed ones, and adds
a short section saying the volume holds credentials and should not be shared or exported.

Its relation to #75

These two overlap, and it is worth being explicit about how, because merging both as they are
would break container creation.

this branch #75
Where the volume is declared in linux/ and wslg/, separately once in the shared feature
gh login not covered covered, same mechanism
Dockerfile seeds ~/.codex seeds ~/.codex and ~/.config/gh
The README rule the sentence is removed the sentence is narrowed to its actual reason

They agree on the principle. This branch removed that rule sentence in August; #75 argues
the same conclusion from the other end — what must stay out of the repository is a secret or
an internal address, and a mount line is neither. That agreement was reached twice
independently, which is a decent sign it is right.

Where they collide: git merge-tree reports content conflicts in .devcontainer/Dockerfile
and .devcontainer/README.md. And if both were merged with the conflicts resolved naively,
linux/ and wslg/ would declare wordclock-codex and inherit it from the feature — two
mounts on one target, which fails container creation rather than being ignored.

So one of two orders

Either is fine. What is not fine is merging both without resolving the duplicate mounts, so
whichever goes second needs the rebase.

@AndreasBur
AndreasBur merged commit 14ab13f into master Aug 25, 2026
8 checks passed
AndreasBur pushed a commit that referenced this pull request Aug 25, 2026
Builds on #76, which persisted the Codex login by declaring its volume in each
committed variant. Two things were left.

gh was not covered, and has the same problem for the same reason: its
configuration lives in the container's home, so every rebuild costs a fresh
`gh auth login` - which is noticed one push later rather than at the rebuild.

And the volume was declared twice, in linux/ and in wslg/, which is one place too
many for a mount both variants want. It belongs where ~/.platformio already is:
the shared feature, which every variant loads. That also covers a variant nobody
had thought about - wslg had the same gap and was fixed by the same line. So the
two per-variant declarations come out again; leaving them in would put two mounts
on one target, which fails container creation rather than being ignored.

The Dockerfile seeds ~/.config/gh beside ~/.codex, at 0700 for both: an empty
named volume takes its ownership from the path it covers, and gh refuses to read
a config directory others can enter.

The README's two passages became one. #76 put its section high up, where somebody
looking for it will find it, and that is where this stays - carrying both volumes
now, the reason they are in the feature, and the seeding. Further down, the
sentence #76 struck out is replaced rather than left as a gap: what must stay out
of a committed variant is a secret or an internal address, and a mount line is
neither.

Not verified by a build. There is no Docker daemon in the container, so what was
checked is that the JSON parses and that no variant now collides with the feature
on a mount target. The test is two rebuilds of the Linux variant: the first
creates the volumes, the second is the one that shows a login survived.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants