diff --git a/Dockerfile b/Dockerfile index 2852441..a0b6b38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ COPY ros_entrypoint.sh . RUN echo 'source /opt/ros/iron/setup.bash; ros2 launch foxglove_bridge foxglove_bridge_launch.xml' >> /run.sh && chmod +x /run.sh -RUN echo 'alias run="su - ros /run.sh"' >> /etc/bash.bashrc +RUN echo 'alias run="su - ros --whitelist-environment=\"ROS_DOMAIN_ID\" /run.sh"' >> /etc/bash.bashrc \ No newline at end of file diff --git a/ros_entrypoint.sh b/ros_entrypoint.sh index fe16d31..c69327c 100755 --- a/ros_entrypoint.sh +++ b/ros_entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -id -u ros &>/dev/null || adduser --quiet --disabled-password --gecos '' --uid ${UID:=1000} --uid ${GID:=1000} ros +id -u ros &>/dev/null || adduser --quiet --disabled-password --gecos '' --uid ${UID:=1000} ros source /opt/ros/${ROS_DISTRO}/setup.bash diff --git a/run.sh b/run.sh index 2c23b85..ae065cf 100755 --- a/run.sh +++ b/run.sh @@ -6,7 +6,7 @@ docker run -it --rm \ --network=host \ --ipc=host \ --pid=host \ ---env UID=$(id -u) \ ---env GID=$(id -g) \ +--env UID=${MY_UID} \ +--env ROS_DOMAIN_ID \ --privileged \ ghcr.io/helix-robotics-ag/${REPOSITORY_NAME}:iron