Skip to content

Commit

Permalink
Merge pull request #1 from helix-robotics-ag/seb/use_ros_domain_id
Browse files Browse the repository at this point in the history
 Use ROS_DOMAIN_ID from host env variable
  • Loading branch information
sebtiburzio authored Feb 8, 2024
2 parents 6d5cc6b + 3170222 commit ec8c92b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ec8c92b

Please sign in to comment.