Tools: docker_run.sh fix entrypoint as user

- modern docker can specify the user at runtime (--user)
This commit is contained in:
Daniel Agar
2025-02-18 00:26:06 -05:00
committed by GitHub
parent 38de04a53a
commit 90b2290700
2 changed files with 2 additions and 16 deletions
+1 -15
View File
@@ -1,6 +1,5 @@
#!/bin/bash
echo "[docker-entrypoint.sh] Starting entrypoint"
# Start virtual X server in the background
# - DISPLAY default is :99, set in dockerfile
# - Users can override with `-e DISPLAY=` in `docker run` command to avoid
@@ -17,17 +16,4 @@ if [ -n "${ROS_DISTRO}" ]; then
source "/opt/ros/$ROS_DISTRO/setup.bash"
fi
echo "[docker-entrypoint.sh] Working Directory: ${pwd}"
# Use the LOCAL_USER_ID if passed in at runtime
if [ -n "${LOCAL_USER_ID}" ]; then
echo "[docker-entrypoint.sh] Starting with: $LOCAL_USER_ID:user"
# modify existing user's id
usermod -u $LOCAL_USER_ID user
# run as user
# exec gosu user "$@"
exec "$@"
else
exec "$@"
fi
exec "$@"