fix(docker): fix volume mount path and add permission error guidance

This commit is contained in:
Xubin Ren
2026-04-06 13:15:40 +00:00
parent 4dac0a8930
commit bf459c7887
3 changed files with 25 additions and 6 deletions
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
dir="$HOME/.nanobot"
if [ -d "$dir" ] && [ ! -w "$dir" ]; then
owner_uid=$(stat -c %u "$dir" 2>/dev/null || stat -f %u "$dir" 2>/dev/null)
cat >&2 <<EOF
Error: $dir is not writable (owned by UID $owner_uid, running as UID $(id -u)).
Fix (pick one):
Host: sudo chown -R 1000:1000 ~/.nanobot
Docker: docker run --user \$(id -u):\$(id -g) ...
Podman: podman run --userns=keep-id ...
EOF
exit 1
fi
exec nanobot "$@"