Skip to content

Commit

Permalink
Fallback to apt as nala is not always supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl committed Jun 25, 2024
1 parent b289773 commit b73cf39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
5 changes: 0 additions & 5 deletions scripts/setup-ros-workspace.bash
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,6 @@ create_workspace_docker () {
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
Expand Down
11 changes: 5 additions & 6 deletions templates/docker/nvidia.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ 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
# upgrade the system
RUN apt update -y && apt 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 git-lfs nano sudo tmux tree vim iputils-ping wget bash-completion pip trash-cli
RUN apt update && apt install -y git git-lfs nano sudo tmux tree vim iputils-ping wget bash-completion pip trash-cli
RUN pip install pre-commit

# install ROS:ROS_DUMMY_VERSION dependencies
RUN nala install -y curl gnupg gnupg2 lsb-release software-properties-common && apt-add-repository universe
RUN apt 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
Expand All @@ -47,7 +46,7 @@ RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o
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 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 apt update && DEBIAN_FRONTEND=noniteractive apt install -y ros-ROS_DUMMY_VERSION-desktop python3-colcon-common-extensions python3-vcstool
RUN pip install -U rosdep && \
rosdep init

Expand Down
11 changes: 5 additions & 6 deletions templates/docker/standard.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ 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
# upgrade the system
RUN apt update -y && apt upgrade -y

# Install basic utilities
RUN nala update && nala install -y git git-lfs nano sudo tmux tree vim iputils-ping wget bash-completion pip trash-cli
RUN apt update && apt install -y git git-lfs nano sudo tmux tree vim iputils-ping wget bash-completion pip trash-cli
RUN pip install pre-commit

# install ROS:ROS_DUMMY_VERSION dependencies
RUN nala install -y curl gnupg gnupg2 lsb-release software-properties-common && apt-add-repository universe
RUN apt 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
Expand All @@ -44,7 +43,7 @@ RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o
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 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 apt update && DEBIAN_FRONTEND=noniteractive apt install -y ros-ROS_DUMMY_VERSION-desktop python3-colcon-common-extensions python3-vcstool
RUN pip install -U rosdep && \
rosdep init

Expand Down

0 comments on commit b73cf39

Please sign in to comment.