Skip to content

Commit a4536c4

Browse files
thejoeejoeeOpenCode AgentJan Trnka
authored
fix(entrypoint): suppress chown errors on read-only bind mounts (#72)
Read-only bind mounts inside chowned trees cause chown -R to fail with EPERM, killing the entrypoint under set -e. Make all chown calls best-effort with 2>/dev/null || true. Co-authored-by: OpenCode Agent <agent@opencode> Co-authored-by: Jan Trnka <jan.trnka@firma.seznam.cz>
1 parent c5366d2 commit a4536c4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

internal/embed/assets/entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ iptables -A OUTPUT -d 192.168.0.0/16 -j DROP
7070
iptables -A OUTPUT -d 169.254.0.0/16 -j DROP
7171
iptables -A OUTPUT -d 100.64.0.0/10 -j DROP
7272

73-
chown -R 1000:1000 /home/agent/.local /home/agent/.cache
74-
chown 1000:1000 /home/agent/.claude
73+
chown -R 1000:1000 /home/agent/.local /home/agent/.cache 2>/dev/null || true
74+
chown 1000:1000 /home/agent/.claude 2>/dev/null || true
7575

7676
if [ -S /run/ssh-agent.sock ]; then
7777
chown 1000:1000 /run/ssh-agent.sock 2>/dev/null || true
7878
fi
7979

8080
if [ -d /home/agent/.ssh ]; then
81-
chown 1000:1000 /home/agent/.ssh
81+
chown 1000:1000 /home/agent/.ssh 2>/dev/null || true
8282
fi
8383

8484
exec setpriv --reuid=1000 --regid=1000 --init-groups --inh-caps=-all --no-new-privs -- env HOME=/home/agent "$@"

0 commit comments

Comments
 (0)