2026-04-04 00:16:41 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
set -e
|
|
|
|
|
|
2026-04-14 20:55:42 +08:00
|
|
|
# Fix ownership of mounted volumes so the non-root ashim user can write.
|
|
|
|
|
# This runs as root, fixes permissions, then drops to ashim via gosu.
|
2026-04-04 00:16:41 +08:00
|
|
|
if [ "$(id -u)" = "0" ]; then
|
2026-04-14 20:55:42 +08:00
|
|
|
chown -R ashim:ashim /data /tmp/workspace 2>&1 || \
|
2026-04-04 14:06:48 +08:00
|
|
|
echo "WARNING: Could not fix volume permissions. If processing fails, check your volume mount permissions." >&2
|
2026-04-14 20:55:42 +08:00
|
|
|
exec gosu ashim "$@"
|
2026-04-04 00:16:41 +08:00
|
|
|
fi
|
|
|
|
|
|
2026-04-14 20:55:42 +08:00
|
|
|
# Already running as ashim (e.g. Kubernetes runAsUser)
|
2026-04-04 00:16:41 +08:00
|
|
|
exec "$@"
|