Skip to content

Commit 2f19424

Browse files
authored
Add CUDA installation scripts and update Dockerfile for ROS 2 Jazzy (#270)
* Add CUDA installation scripts and update Dockerfile for ROS 2 Jazzy Signed-off-by: Max Waterhout <max.waterhout@hotmail.nl> * Add CUDA installation step to Dockerfile Signed-off-by: Max Waterhout <max.waterhout@hotmail.nl> * WIP Signed-off-by: Max Waterhout <max.waterhout@hotmail.nl> * Add rosdep initialization step in Dockerfile Signed-off-by: Max Waterhout <max.waterhout@hotmail.nl> * WIP Signed-off-by: Max Waterhout <max.waterhout@hotmail.nl> * try without extra packages Signed-off-by: Max Waterhout <max.waterhout@hotmail.nl> --------- Signed-off-by: Max Waterhout <max.waterhout@hotmail.nl>
1 parent 9736594 commit 2f19424

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

dockerfiles/general/pre_install.dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
#Pull the base image:
6-
FROM osrf/ros:jazzy-desktop
6+
FROM nvidia/cuda:12.9.1-devel-ubuntu24.04 AS base
77
ARG COLCON_BUILD_SEQUENTIAL
88
ENV UNAME=rcdt
99
ENV UID=1000
@@ -20,5 +20,4 @@ RUN apt update
2020

2121
# Create bashrc file:
2222
RUN echo "if test -f ~/.personal.bashrc; then\nsource ~/.personal.bashrc\nfi" >> /home/$UNAME/.bashrc
23-
RUN echo "if test -f ~/.env; then\nset -a && source ~/.env && set +a\nfi" >> /home/$UNAME/.bashrc
24-
RUN echo "source /opt/ros/jazzy/setup.bash" >> /home/$UNAME/.bashrc
23+
RUN echo "if test -f ~/.env; then\nset -a && source ~/.env && set +a\nfi" >> /home/$UNAME/.bashrc
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash -i
2+
3+
# SPDX-FileCopyrightText: Alliander N. V.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
set -e
8+
source /home/$UNAME/.bashrc
9+
apt update
10+
11+
apt install -y software-properties-common
12+
add-apt-repository universe
13+
14+
apt update && apt install -y curl
15+
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')
16+
curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" # If using Ubuntu derivates use $UBUNTU_CODENAME
17+
dpkg -i /tmp/ros2-apt-source.deb
18+
19+
apt-get update
20+
apt-get install -y --no-install-recommends \
21+
ros-dev-tools \
22+
ros-jazzy-desktop
23+
24+
rosdep init
25+
rosdep update
26+
27+
echo "source /opt/ros/jazzy/setup.bash" >> /home/$UNAME/.bashrc

dockerfiles/rcdt_robotics.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
INCLUDE ./general/pre_install.dockerfile
77

8+
COPY ./install_scripts/ros2_jazzy.sh .
9+
RUN ./ros2_jazzy.sh
10+
811
COPY ./install_scripts/core_packages.sh .
912
RUN ./core_packages.sh
1013

0 commit comments

Comments
 (0)