From f165a664b4619a16323562ec49b10030c87becf6 Mon Sep 17 00:00:00 2001 From: Andres Montano <andres.montano@tecnalia.com> Date: Thu, 7 Nov 2024 17:53:11 +0100 Subject: [PATCH] Fix Issue with SHELL --- dockerfiles/devenv.Dockerfile | 12 ++++++------ dockerfiles/ros_entrypoint.sh | 13 +------------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/dockerfiles/devenv.Dockerfile b/dockerfiles/devenv.Dockerfile index 815f159..8aee25f 100644 --- a/dockerfiles/devenv.Dockerfile +++ b/dockerfiles/devenv.Dockerfile @@ -8,7 +8,7 @@ ENV ROS_DISTRO "${ROS_DISTRO}" ARG EXT_SHELL=bash ENV EXT_SHELL "${EXT_SHELL}" -ENV SHELL="/bin/${SHELL}" +ENV SHELL "/bin/${EXT_SHELL}" RUN echo "Building devenv for ROS" $ROS_DISTRO "with shell" $EXT_SHELL # Avoid warnings by switching to noninteractive @@ -123,10 +123,6 @@ RUN chmod a+x /ros_entrypoint.sh # Set running in docker for zsh powerlevel10k ENV RUNNING_IN_DOCKER true -# Set extra environment variables for ROS2 -ENV ROS_LOCALHOST_ONLY=1 -ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp - # Define entrypoint and command ENTRYPOINT ["/ros_entrypoint.sh"] CMD $EXT_SHELL @@ -142,7 +138,7 @@ ENV DEBIAN_FRONTEND= FROM devenv as workspace-extended # Avoid warnings by switching to noninteractive -ENV DEBIAN_FRONTEND=noninteractive +ENV DEBIAN_FRONTEND noninteractive # Install extra packages ws_dependencies ARG PACKAGES=none @@ -198,3 +194,7 @@ RUN apt-get update \ # Switch back to dialog for any ad-hoc use of apt-get ENV DEBIAN_FRONTEND= + +# Define entrypoint and command +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD $EXT_SHELL diff --git a/dockerfiles/ros_entrypoint.sh b/dockerfiles/ros_entrypoint.sh index af538a0..f1dbf0a 100644 --- a/dockerfiles/ros_entrypoint.sh +++ b/dockerfiles/ros_entrypoint.sh @@ -1,15 +1,4 @@ #!/usr/bin/env bash -# Check if the shell is Bash or Zsh -if [ -n "$BASH_VERSION" ]; then - # Bash - source "/opt/ros/$ROS_DISTRO/setup.bash" -elif [ -n "$ZSH_VERSION" ]; then - # Zsh - source "/opt/ros/$ROS_DISTRO/setup.zsh" -else - echo "Unknown shell. This script is designed for Bash and Zsh." - return 1 -fi - +source "/opt/ros/$ROS_DISTRO/setup.bash" exec "$@" -- GitLab