Update Dockerfile and package naming

This commit is contained in:
e.rosendahl
2025-07-28 01:12:59 +02:00
parent 21e1b84e7a
commit be93645b4d
7 changed files with 50 additions and 29 deletions

View File

@ -3,7 +3,7 @@ FROM ubuntu:24.04
ENV PIP_BREAK_SYSTEM_PACKAGES=1 \
SHELL=/bin/bash
ARG USERNAME=can_viewer
ARG USERNAME=ft_analytics
ARG USER_UID=1000
ARG USER_GID=${USER_UID}
@ -18,34 +18,41 @@ RUN if id -u "${USER_UID}" >/dev/null 2>&1; then \
&& chmod 0440 /etc/sudoers.d/${USERNAME}
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-pip \
nano \
iproute2 \
can-utils \
lsb-release \
curl \
gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir python-can cantools python3-rosdep
&& apt-get install -y --no-install-recommends curl gnupg lsb-release ca-certificates
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 \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | gpg --dearmor -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ros-jazzy-ros-core \
python3-colcon-common-extensions \
python3-pip \
nano \
iproute2 \
can-utils \
python3-rosdep \
build-essential \
cmake \
kmod \
&& rm -rf /var/lib/apt/lists/*
RUN echo "source /opt/ros/jazzy/setup.bash" >> /home/${USERNAME}/.bashrc \
&& echo "source /workspaces/can_viewer/install/setup.bash" >> /home/${USERNAME}/.bashrc
RUN pip3 install --no-cache-dir --upgrade --break-system-package \
python-can cantools
RUN echo "source /opt/ros/jazzy/setup.bash" >> /home/${USERNAME}/.bashrc \
&& echo "source /workspaces/ft_analytics/install/setup.bash" >> /home/${USERNAME}/.bashrc
WORKDIR /workspaces/ft_analytics
RUN mkdir -p /workspaces/ft_analytics/ros2_ws/src
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 init \
&& apt-get update \
&& rosdep update \
&& rosdep install -r --rosdistro jazzy --from-paths ros2_ws/src --ignore-src -y
USER ${USERNAME}
CMD ["/bin/bash"]