From 21e1b84e7afd7c55af0e888efaac61347c1ac370 Mon Sep 17 00:00:00 2001 From: Elias Rosendahl Date: Mon, 21 Jul 2025 15:02:49 +0200 Subject: [PATCH] add ros2-jazzy instalation in Dockerfile --- docker/Dockerfile | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 6ff834b..74be5e3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,28 +18,33 @@ RUN if id -u "${USER_UID}" >/dev/null 2>&1; then \ && chmod 0440 /etc/sudoers.d/${USERNAME} RUN apt-get update \ - && apt-get upgrade -y \ && apt-get install -y --no-install-recommends \ python3-pip \ nano \ - python3-rosdep \ + iproute2 \ + can-utils \ + lsb-release \ + curl \ + gnupg \ && rm -rf /var/lib/apt/lists/* -RUN pip3 install --no-cache-dir python-can cantools + RUN pip3 install --no-cache-dir python-can cantools python3-rosdep -RUN echo "source /opt/ros/jazzy/setup.bash" \ - >> /home/${USERNAME}/.bashrc \ - && echo "source /workspaces/can_viewer/install/setup.bash" \ - >> /home/${USERNAME}/.bashrc +RUN echo "deb [signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \ + && curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | gpg --dearmor -o /usr/share/keyrings/ros-archive-keyring.gpg \ + && apt-get update \ + && apt-get install -y --no-install-recommends ros-jazzy-ros-core python3-colcon-common-extensions \ + && rm -rf /var/lib/apt/lists/* -RUN usermod --shell /bin/bash -aG video ${USERNAME} +RUN echo "source /opt/ros/jazzy/setup.bash" >> /home/${USERNAME}/.bashrc \ + && echo "source /workspaces/can_viewer/install/setup.bash" >> /home/${USERNAME}/.bashrc WORKDIR /workspaces/can_viewer COPY --chown=${USERNAME}:${USERNAME} ros2_ws/src ros2_ws/src -RUN rosdep update \ - && rosdep install -r --rosdistro jazzy \ - --from-paths ros2_ws/src --ignore-src -y +#RUN rosdep update \ +# && rosdep install -r --rosdistro jazzy \ +# --from-paths ros2_ws/src --ignore-src -y USER ${USERNAME}