Files
shannon/entrypoint.sh
T
ezl-keygraph de8b7c368d fix: resolve Docker bind mount permission errors on Linux
Use entrypoint-based UID remapping instead of --user flag so the
container's pentest user matches the host UID/GID, keeping bind-mounted
volumes writable. Git config moved to --system level to survive remapping.
2026-03-18 15:58:45 +05:30

19 lines
508 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
TARGET_UID="${SHANNON_HOST_UID:-}"
TARGET_GID="${SHANNON_HOST_GID:-}"
CURRENT_UID=$(id -u pentest 2>/dev/null || echo "")
if [ -n "$TARGET_UID" ] && [ "$TARGET_UID" != "$CURRENT_UID" ]; then
deluser pentest 2>/dev/null || true
delgroup pentest 2>/dev/null || true
addgroup -g "$TARGET_GID" pentest
adduser -u "$TARGET_UID" -G pentest -s /bin/bash -D pentest
chown -R pentest:pentest /app/sessions /app/deliverables /app/workspaces
fi
exec su pentest -c "exec $*"