OpenClaw: use canonical ~/.openclaw home#149
Merged
Conversation
mostlydev
added a commit
that referenced
this pull request
Apr 14, 2026
PR #149 (v0.8.8) tmpfs'd only /root/.openclaw, leaving /root at the image layer's baked-in mode 0700 root:root. Any openclaw image whose runtime USER is not root — including the upstream ghcr.io/openclaw/openclaw image and the documented "RUN apt install … && USER node" pattern used by every Tiverton trader — could not traverse /root to reach the writable tmpfs, so the gateway crash-looped on startup with "EACCES: permission denied, mkdir '/root/.openclaw/config'". Move the tmpfs one level up: mount /root itself at mode 1777. Docker still creates /root/.openclaw on top of it as the bind-mount target for the config directory, the canonical OPENCLAW_CONFIG_PATH/STATE_DIR contract is unchanged, and any container USER (root or not) can now traverse in. Add a unit regression that fails fast if a future change re-introduces the /root/.openclaw tmpfs path, plus a live spike (TestSpikeOpenClawNonRootHomeReachable) that builds a USER 1000 stub and asserts the entrypoint can stat each component of /root/.openclaw/config before the gateway starts. Verified the spike fails on the v0.8.8 layout and passes on the fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.openclawlayout inside the containerOPENCLAW_HOMEshim and keep config mounted at/root/.openclaw/config/openclaw.jsonTesting
Closes #121