Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ROS2/AMD64x86/humble_cuda/aptPkgs.list
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ tzdata
v4l-utils
vim
wget
xterm
xterm
libeigen3-dev
11 changes: 11 additions & 0 deletions ROS2/AMD64x86/wheelchair2_base_cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN cd Livox-SDK2 \
&& cmake .. && make -j \
&& sudo make install -j4


COPY rosPkgs.list /tmp/rosPkgs.list
RUN sudo apt-get update \
&& sudo apt-get -y install --no-install-recommends $(cat /tmp/rosPkgs.list) \
Expand All @@ -41,6 +42,16 @@ RUN sudo apt-get update \
&& pip3 install $(cat /tmp/pythonPkgs.list) \
&& sudo rm -rf /var/lib/apt/lists/*

# 3D-BBS
WORKDIR /home/container_user
RUN git clone https://github.com/KOKIAOKI/3d_bbs.git --recursive --depth 1
RUN cd 3d_bbs \
&& mkdir build && cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=Release && make -j \
&& sudo make install \
&& cd /home/container_user \
&& rm -rf 3d_bbs

#Install Miniconda
# RUN mkdir -p ~/miniconda3 && \
# wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \
Expand Down
39 changes: 32 additions & 7 deletions ROS2/Jetson/humble_jetson/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM nvcr.io/nvidia/l4t-jetpack:r36.2.0
# basic args
ARG ROS_DISTRO=humble
ARG USERNAME=container_user
ARG USER_UID=1000
ARG USER_UID=1002
ARG USER_GID=$USER_UID

# Add metadata labels
Expand Down Expand Up @@ -53,18 +53,43 @@ RUN apt-get update && apt-get install -q -y --no-install-recommends \
ros-$ROS_DISTRO-desktop \
&& rm -rf /var/lib/apt/lists/*

# Create non root user with sudo privilege
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
USER $USERNAME
# Perform all root-level system modifications first
USER root

# 1. Resolve GID conflicts for Jetson hardware groups (video=44, render=104)
RUN EXISTING_RENDER_GROUP=$(getent group 104 | cut -d: -f1) && \
if [ ! -z "$EXISTING_RENDER_GROUP" ] && [ "$EXISTING_RENDER_GROUP" != "render" ]; then \
groupmod -g 9904 "$EXISTING_RENDER_GROUP"; \
fi && \
groupmod -g 44 video || true && \
groupmod -g 104 render || true

# 2. Robust User Creation: Check if name/UID/GID exists before creating
RUN if getent passwd $USERNAME; then \
usermod -u $USER_UID $USERNAME && \
groupmod -g $USER_GID $USERNAME || true; \
else \
# Evict GID 1002 if it's taken by a system group (like 'nvidia')
EXISTING_VAL_GROUP=$(getent group $USER_GID | cut -d: -f1); \
if [ ! -z "$EXISTING_VAL_GROUP" ]; then groupmod -g 9992 "$EXISTING_VAL_GROUP"; fi; \
groupadd --gid $USER_GID $USERNAME && \
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME; \
fi && \
# Grant sudo and hardware access
usermod -aG sudo,video,render,i2c $USERNAME && \
echo "$USERNAME ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME

# setup entrypoint
COPY ./ros_entrypoint.sh /

ENTRYPOINT ["/ros_entrypoint.sh"]

ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=all

USER $USERNAME

# bootstrap rosdep
RUN sudo rosdep init && \
rosdep update --rosdistro $ROS_DISTRO
Expand Down
3 changes: 2 additions & 1 deletion ROS2/Jetson/humble_jetson/aptPkgs.list
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ tzdata
v4l-utils
vim
wget
xterm
xterm
libeigen3-dev
13 changes: 12 additions & 1 deletion ROS2/Jetson/wheelchair2_base_jetson/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/smart-wheelchair-rrc/humble_jetson:v5.0
FROM ghcr.io/smart-wheelchair-rrc/humble_jetson:dev5.1.2

ARG USERNAME=container_user

Expand Down Expand Up @@ -42,6 +42,17 @@ RUN sudo apt-get update \
&& pip3 install $(cat /tmp/pythonPkgs.list) \
&& sudo rm -rf /var/lib/apt/lists/*


#3D-BBS
WORKDIR /home/container_user
RUN git clone https://github.com/KOKIAOKI/3d_bbs.git --recursive --depth 1
RUN cd 3d_bbs \
&& mkdir build && cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=Release && make -j \
&& sudo make install \
&& cd /home/container_user \
&& rm -rf 3d_bbs

#Install Miniconda
# RUN mkdir -p ~/miniconda3 && \
# wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \
Expand Down
Loading