diff --git a/scripts/docker/_RosTeamWs_Docker_Defines.bash b/scripts/docker/_RosTeamWs_Docker_Defines.bash index dbd67b7f..530d405d 100755 --- a/scripts/docker/_RosTeamWs_Docker_Defines.bash +++ b/scripts/docker/_RosTeamWs_Docker_Defines.bash @@ -19,8 +19,8 @@ source $docker_script_own_dir/../_RosTeamWs_Defines.bash # assoziative array which maps the chosen rosdistro to the name which is used to install the corresponding # ros distribution inside docker -declare -r -A map_to_docker_ros_distro_name=( ["foxy"]="foxy" ["galactic"]="galactic" ["rolling"]="rolling" ["humble"]="humble") -declare -r -A ros_distro_to_rtw_branch=( ["foxy"]="foxy" ["galactic"]="master" ["rolling"]="master" ["humble"]="master") +declare -r -A map_to_docker_ros_distro_name=( ["noetic"]="noetic" ["foxy"]="foxy" ["galactic"]="galactic" ["rolling"]="rolling" ["humble"]="humble") +declare -r -A ros_distro_to_rtw_branch=( ["noetic"]="master" ["foxy"]="foxy" ["galactic"]="master" ["rolling"]="master" ["humble"]="master") # $1 = name (tag) of the created docker image # $2 = Dockerfile which is used for creating the image diff --git a/scripts/setup-ros-workspace.bash b/scripts/setup-ros-workspace.bash index 62edb9bc..9d7090d0 100755 --- a/scripts/setup-ros-workspace.bash +++ b/scripts/setup-ros-workspace.bash @@ -7,7 +7,7 @@ source $setup_ws_script_own_dir/docker/_RosTeamWs_Docker_Defines.bash # All the possible supported ros distributions supported by rtw if [ -z "$ros_distributions_20_04" ]; then - readonly ros_distributions_20_04=("foxy" "galactic") + readonly ros_distributions_20_04=("noetic" "foxy" "galactic") fi if [ -z "$ros_distributions_22_04" ]; then readonly ros_distributions_22_04=("humble") @@ -50,6 +50,8 @@ select_normal_or_nvidia_docker() { notify_user "To abort press +, to continue press ." read esac + + } check_user_input () { @@ -357,6 +359,25 @@ create_workspace_docker () { sed -i "s/UBUNTU_DUMMY_VERSION/${ubuntu_version}/g" "$ws_docker_folder/Dockerfile" sed -i "s/ROS_DUMMY_VERSION/${docker_ros_distro_name}/g" "$ws_docker_folder/Dockerfile" sed -i "s/ROS_TEAM_WS_DUMMY_BRANCH/${rtw_branch_for_ros_distro}/g" "$ws_docker_folder/Dockerfile" + if [[ "${ubuntu_version}" == *20.04* ]]; then + DOCKER_FILE="$ws_docker_folder/Dockerfile" + TMP_FILE="$ws_docker_folder/.tmp_Dockerfile" + mv $DOCKER_FILE "$TMP_FILE" + TEST_LINE=`awk '$1 == "#" && $2 == "install" && $3 == "nala" { print NR }' $TMP_FILE` # get line before `# install nala and upgrade` dependency + let CUT_LINE=$TEST_LINE-0 + head -$CUT_LINE $TMP_FILE > $DOCKER_FILE + + echo "RUN apt update -y && apt install -y wget" >> $DOCKER_FILE + echo "RUN echo \"deb [arch=amd64,arm64,armhf] http://deb.volian.org/volian/ scar main\" | tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list" >> $DOCKER_FILE + echo "RUN wget -qO - https://deb.volian.org/volian/scar.key | tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null" >> $DOCKER_FILE + echo "RUN apt update -y && apt install -y nala-legacy" >> $DOCKER_FILE + + # Add last part + let CUT_LINE=$TEST_LINE+2 + tail -n +$CUT_LINE $TMP_FILE >> $DOCKER_FILE + + rm $TMP_FILE + fi # setup ros_team_ws cp "$DOCKER_TEMPLATES/ros_team_ws_rc_docker" "$ws_docker_folder/." diff --git a/templates/docker/nvidia.dockerfile b/templates/docker/nvidia.dockerfile index 43d5d1a7..7322537c 100644 --- a/templates/docker/nvidia.dockerfile +++ b/templates/docker/nvidia.dockerfile @@ -9,12 +9,8 @@ ARG home # make bash default SHELL ["/bin/bash", "-c"] -# upgrade to newest version -RUN apt-get update -y && apt-get install -y nala -RUN nala upgrade --assume-yes - # install locales -RUN nala install -y locales nala +RUN apt update -y && apt install -y locales # Configure user env ENV TZ=Europe/Berlin @@ -27,22 +23,34 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -# Nvidia variables -ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics - # Make sure UTF-8 is supported RUN locale +# install nala and upgrade +RUN apt update -y && apt install -y nala +RUN nala upgrade -y + +# Nvidia variables +ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics + # Install basic utilities -RUN nala update && nala install -y git nano sudo tmux tree vim iputils-ping wget bash-completion pre-commit trash-cli gh +RUN nala update && nala install -y git git-lfs nano sudo tmux tree vim iputils-ping wget bash-completion pip trash-cli +RUN pip install pre-commit -# install ROS2:ROS_DUMMY_VERSION dependencies +# install ROS:ROS_DUMMY_VERSION dependencies RUN nala install -y curl gnupg gnupg2 lsb-release software-properties-common && apt-add-repository universe + +# Add key to keyring RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg + +# ROS repository +RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/ros.list > /dev/null + +# ROS2 repository RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null -# install ROS2:ROS_DUMMY_VERSION and things needed for ros development, DEBIAN_FRONTEND is needed to ignore interactive keyboard layout setting while install -RUN nala update && DEBIAN_FRONTEND=noniteractive nala install -y ros-ROS_DUMMY_VERSION-desktop pip python3-colcon-common-extensions python3-vcstool +# install ROS:ROS_DUMMY_VERSION and things needed for ros development, DEBIAN_FRONTEND is needed to ignore interactive keyboard layout setting while install +RUN nala update && DEBIAN_FRONTEND=noniteractive nala install -y ros-ROS_DUMMY_VERSION-desktop python3-colcon-common-extensions python3-vcstool RUN pip install -U rosdep && \ rosdep init diff --git a/templates/docker/standard.dockerfile b/templates/docker/standard.dockerfile index adb19523..4b2a93c5 100644 --- a/templates/docker/standard.dockerfile +++ b/templates/docker/standard.dockerfile @@ -9,12 +9,8 @@ ARG home # make bash default SHELL ["/bin/bash", "-c"] -# upgrade to newest version -RUN apt-get update -y && apt-get install -y nala -RUN nala upgrade --assume-yes - # install locales -RUN nala install -y locales nala +RUN apt update -y && apt install -y locales # Configure user env ENV TZ=Europe/Berlin @@ -30,16 +26,28 @@ ENV LC_ALL en_US.UTF-8 # Make sure UTF-8 is supported RUN locale +# install nala and upgrade +RUN apt update -y && apt install -y nala +RUN nala upgrade -y + # Install basic utilities -RUN nala update && nala install -y git nano sudo tmux tree vim iputils-ping wget bash-completion pre-commit trash-cli gh +RUN nala update && nala install -y git git-lfs nano sudo tmux tree vim iputils-ping wget bash-completion pip trash-cli +RUN pip install pre-commit -# install ROS2:ROS_DUMMY_VERSION dependencies +# install ROS:ROS_DUMMY_VERSION dependencies RUN nala install -y curl gnupg gnupg2 lsb-release software-properties-common && apt-add-repository universe + +# Add key to keyring RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg + +# ROS repository +RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/ros.list > /dev/null + +# ROS2 repository RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null -# install ROS2:ROS_DUMMY_VERSION and things needed for ros development, DEBIAN_FRONTEND is needed to ignore interactive keyboard layout setting while install -RUN nala update && DEBIAN_FRONTEND=noniteractive nala install -y ros-ROS_DUMMY_VERSION-desktop pip python3-colcon-common-extensions python3-vcstool +# install ROS:ROS_DUMMY_VERSION and things needed for ros development, DEBIAN_FRONTEND is needed to ignore interactive keyboard layout setting while install +RUN nala update && DEBIAN_FRONTEND=noniteractive nala install -y ros-ROS_DUMMY_VERSION-desktop python3-colcon-common-extensions python3-vcstool RUN pip install -U rosdep && \ rosdep init