From 44f9d1dd2a64f57e3b6ddc98fb005a550772207b Mon Sep 17 00:00:00 2001 From: Bastian Hofmann Date: Wed, 28 Sep 2022 16:09:49 +0200 Subject: [PATCH] Added DISPLAY to env. Did you know echo cmd was unstable? I didn't. --- build_ros/entrypoint.sh | 7 +++++-- start.sh | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build_ros/entrypoint.sh b/build_ros/entrypoint.sh index d794946..e4b6b6a 100755 --- a/build_ros/entrypoint.sh +++ b/build_ros/entrypoint.sh @@ -18,16 +18,19 @@ if [ "0" == "$(cat /home/ros/docker_image_version)" ]; then echo "Created workspace" su ros -c "cd /home/ros/workspace; colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja" echo "Built workspace" - echo "1" > /home/ros/docker_image_version + printf "1" > /home/ros/docker_image_version fi + + if [ ! -f /home/ros/.ssh/id_rsa ]; then su ros -c "ssh-keygen -N '' -f /home/ros/.ssh/id_rsa" echo "Generated SSH Keys." fi echo "ros:ros" | chpasswd -su ros -c "echo 'source /opt/ros/$ROS_DISTRO/setup.bash\nsource /home/ros/workspace/install/setup.bash' > ~/.rosrc" +su ros -c "printf 'source /opt/ros/$ROS_DISTRO/setup.bash\nsource /home/ros/workspace/install/setup.bash' > ~/.rosrc" +printf "DISPLAY=$DISPLAY" > /etc/profile.d/display.sh echo "Ready to connect." diff --git a/start.sh b/start.sh index d49d98b..3ebb563 100755 --- a/start.sh +++ b/start.sh @@ -26,7 +26,6 @@ for host in ${hosts[@]}; do done echo "Attaching." -echo "You are ready for shell access." sudo docker-compose up echo "Removing from xhost:"