-
Notifications
You must be signed in to change notification settings - Fork 5
Login not persistent: $HOME mismatch between host and container #46
Copy link
Copy link
Closed
Description
Problem
The README states that credentials are stored in ~/.claude and login only needs to happen once. However, login is not persistent across container
restarts because the host $HOME path differs from the container user $HOME.
Details
The container launch uses:
-v "$HOME/.claude:$HOME/.claude:Z"
$HOME is expanded on the host (e.g., /home/meng), so credentials are mounted at /home/meng/.claude inside the container.
However, inside the container the user is node with HOME=/home/node. Claude Code looks for credentials at $HOME/.claude → /home/node/.claude,
which is empty. So every session requires a fresh /login.
Workaround
ln -s /home/meng/.claude /home/node/.claude
(Replace /home/meng with your actual host $HOME.)
Suggested fix
Either:
1. Mount to the container user home: -v "$HOME/.claude:/home/node/.claude:Z"
2. Set HOME inside the container to match the host: --env HOME=$HOME
Option 2 is probably simplest.
Environment
- Host user: meng ($HOME=/home/meng)
- Container user: node ($HOME=/home/node)
- Using --userns=keep-idReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels