fix(docker): mount config/workspace for root runtime in compose#834
fix(docker): mount config/workspace for root runtime in compose#8340xYiliu wants to merge 3 commits intosipeed:mainfrom
Conversation
yinwm
left a comment
There was a problem hiding this comment.
This is a Workaround, Not a Proper Fix
The Problem
This PR addresses the symptom (mount paths don't match runtime home directory) but not the root cause (why does home resolve to /root instead of /home/picoclaw?).
Why This Approach Is Problematic
- Masks the real issue - The container is apparently running as
rootwhen it should run aspicoclawuser - Maintenance burden - Every path needs to be mounted twice
- Permission confusion - Files created in workspace may have wrong ownership
- Technical debt - Workarounds accumulate and make future debugging harder
Better Solutions
Option 1: Fix the Dockerfile to run as correct user
USER picoclaw
ENV HOME=/home/picoclawOption 2: Set HOME environment variable in compose
environment:
- HOME=/home/picoclawOption 3: Fix in entrypoint script
#!/bin/bash
if [ "$(id -u)" = "0" ]; then
export HOME=/home/picoclaw
fi
exec picoclaw "$@"Recommendation
Please investigate why the container is resolving home to /root and fix it at the source. The root cause is likely one of:
- Missing
USER picoclawin Dockerfile - Missing
HOMEenvironment variable - Container being run with
--user rootoverride
This double-mount workaround should only be a last resort if there's a legitimate reason the container must run as root.
|
Thanks for the review — agreed this should be fixed at source rather than with dual mounts. I updated the PR with a root-cause fix:
This keeps a single canonical mount path while making runtime home resolution deterministic. Validation:
Could you please take another look? |
|
Update: I synced this branch with upstream/main and resolved the previous merge conflict.\n\nCurrent diff is now minimal and source-focused:\n- add HOME=/home/picoclaw for both compose services in docker/docker-compose.yml\n\nValidation:\n- local make check passed\n- CI rerun is in progress on this latest head\n\nThanks again for the review — please re-check when CI finishes. |
📝 Description
/root./home/picoclaw/.picoclaw/*mounts for compatibility and adds/root/.picoclaw/*mounts for prebuilt-image runtime behavior.🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
Fixes #651
☑️ Checklist
make checkand it passed.