Skip to content

Commit c2da952

Browse files
committed
refactor: Unify docker files across all workspaces
1 parent 13d24f3 commit c2da952

File tree

7 files changed

+372
-97
lines changed

7 files changed

+372
-97
lines changed

cartographer_ws/docker/Dockerfile

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
5959
python3-pip \
6060
&& rm -rf /var/lib/apt/lists/*
6161

62-
# Install custom tools
62+
# Install GUI debugging tools
63+
# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo`
64+
# Ref: https://packages.debian.org/sid/x11-apps
65+
# Ref: https://packages.debian.org/sid/x11-utils
66+
# - `mesa-utils` for `glxgears` and `glxinfo`
67+
# Ref: https://wiki.debian.org/Mesa
68+
# - `vulkan-tools` for `vkcube` and `vulkaninfo`
69+
# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages
70+
# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu
6371
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
6472
apt-get update && apt-get install -y \
65-
git-extras \
73+
x11-apps x11-utils \
74+
mesa-utils \
75+
libgl1 vulkan-tools \
6676
&& rm -rf /var/lib/apt/lists/*
6777

78+
# Setup the required capabilities for the container runtime
79+
# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities
80+
ENV NVIDIA_VISIBLE_DEVICES=all
81+
ENV NVIDIA_DRIVER_CAPABILITIES=all
82+
83+
# Install Vulkan config files
84+
# Ref: https://gitlab.com/nvidia/container-images/vulkan
85+
RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <<EOF
86+
{
87+
"file_format_version" : "1.0.0",
88+
"ICD": {
89+
"library_path": "libGLX_nvidia.so.0",
90+
"api_version" : "1.3.194"
91+
}
92+
}
93+
EOF
94+
6895
# Install ROS2 Gazebo packages for amd64
6996
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
7097
if [ "$TARGETARCH" = "amd64" ]; then \
@@ -80,23 +107,36 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
80107
ros-$ROS_DISTRO-rviz2 \
81108
&& rm -rf /var/lib/apt/lists/*
82109

110+
USER $USERNAME
111+
112+
# Create Gazebo cache directory with correct ownership to avoid permission issues after volume mount
113+
RUN mkdir /home/$USERNAME/.gazebo
114+
115+
# Install Isaac Sim (requires Python 3.10)
116+
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
117+
# TODO: Remove the note above when it is no longer experimental
118+
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
119+
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
120+
if [ "$TARGETARCH" = "amd64" ]; then \
121+
python3 -V | grep "Python 3.10" \
122+
&& pip install isaacsim==4.1.0.0 --extra-index-url https://pypi.nvidia.com \
123+
&& pip install isaacsim-extscache-physics==4.1.0.0 isaacsim-extscache-kit==4.1.0.0 isaacsim-extscache-kit-sdk==4.1.0.0 --extra-index-url https://pypi.nvidia.com; \
124+
fi
125+
126+
# Install custom tools
127+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
128+
sudo apt-get update && sudo apt-get install -y \
129+
git-extras \
130+
&& sudo rm -rf /var/lib/apt/lists/*
131+
83132
# TODO: Add more commands here
84-
# For example, to install additional packages, uncomment the following lines and add the package names
85-
# RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
86-
# apt-get update && apt-get install -y \
87-
# $OTHER_PACKAGES \
88-
# && rm -rf /var/lib/apt/lists/*
89133
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
90-
apt-get update && apt-get install -y \
134+
sudo apt-get update && sudo apt-get install -y \
91135
ros-$ROS_DISTRO-cartographer \
92136
ros-$ROS_DISTRO-turtlebot3* \
93137
ros-$ROS_DISTRO-rqt-robot-steering \
94-
&& rm -rf /var/lib/apt/lists/*
138+
&& sudo rm -rf /var/lib/apt/lists/*
95139

96-
USER $USERNAME
97-
# Create Gazebo cache directory with correct ownership to avoid permission issues after volume mount
98-
RUN mkdir /home/$USERNAME/.gazebo
99-
# TODO: Run additional commands as non-root user here
100140
COPY .bashrc /home/$USERNAME/.bashrc
101141
# TODO: Copy additional files here
102142
ENTRYPOINT []

gazebo_world_ws/docker/Dockerfile

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
5959
python3-pip \
6060
&& rm -rf /var/lib/apt/lists/*
6161

62-
# Install custom tools
62+
# Install GUI debugging tools
63+
# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo`
64+
# Ref: https://packages.debian.org/sid/x11-apps
65+
# Ref: https://packages.debian.org/sid/x11-utils
66+
# - `mesa-utils` for `glxgears` and `glxinfo`
67+
# Ref: https://wiki.debian.org/Mesa
68+
# - `vulkan-tools` for `vkcube` and `vulkaninfo`
69+
# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages
70+
# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu
6371
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
6472
apt-get update && apt-get install -y \
65-
git-extras \
73+
x11-apps x11-utils \
74+
mesa-utils \
75+
libgl1 vulkan-tools \
6676
&& rm -rf /var/lib/apt/lists/*
6777

78+
# Setup the required capabilities for the container runtime
79+
# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities
80+
ENV NVIDIA_VISIBLE_DEVICES=all
81+
ENV NVIDIA_DRIVER_CAPABILITIES=all
82+
83+
# Install Vulkan config files
84+
# Ref: https://gitlab.com/nvidia/container-images/vulkan
85+
RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <<EOF
86+
{
87+
"file_format_version" : "1.0.0",
88+
"ICD": {
89+
"library_path": "libGLX_nvidia.so.0",
90+
"api_version" : "1.3.194"
91+
}
92+
}
93+
EOF
94+
6895
# Install ROS2 Gazebo packages for amd64
6996
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
7097
if [ "$TARGETARCH" = "amd64" ]; then \
@@ -80,17 +107,29 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
80107
ros-$ROS_DISTRO-rviz2 \
81108
&& rm -rf /var/lib/apt/lists/*
82109

83-
# TODO: Add more commands here
84-
# For example, to install additional packages, uncomment the following lines and add the package names
85-
# RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
86-
# apt-get update && apt-get install -y \
87-
# $OTHER_PACKAGES \
88-
# && rm -rf /var/lib/apt/lists/*
89-
90110
USER $USERNAME
111+
91112
# Create Gazebo cache directory with correct ownership to avoid permission issues after volume mount
92113
RUN mkdir /home/$USERNAME/.gazebo
93-
# TODO: Run additional commands as non-root user here
114+
115+
# Install Isaac Sim (requires Python 3.10)
116+
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
117+
# TODO: Remove the note above when it is no longer experimental
118+
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
119+
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
120+
if [ "$TARGETARCH" = "amd64" ]; then \
121+
python3 -V | grep "Python 3.10" \
122+
&& pip install isaacsim==4.1.0.0 --extra-index-url https://pypi.nvidia.com \
123+
&& pip install isaacsim-extscache-physics==4.1.0.0 isaacsim-extscache-kit==4.1.0.0 isaacsim-extscache-kit-sdk==4.1.0.0 --extra-index-url https://pypi.nvidia.com; \
124+
fi
125+
126+
# Install custom tools
127+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
128+
sudo apt-get update && sudo apt-get install -y \
129+
git-extras \
130+
&& sudo rm -rf /var/lib/apt/lists/*
131+
132+
# TODO: Add more commands here
94133
COPY .bashrc /home/$USERNAME/.bashrc
95134
# TODO: Copy additional files here
96135
ENTRYPOINT []

husky_ws/docker/Dockerfile

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
5959
python3-pip \
6060
&& rm -rf /var/lib/apt/lists/*
6161

62-
# Install custom tools
62+
# Install GUI debugging tools
63+
# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo`
64+
# Ref: https://packages.debian.org/sid/x11-apps
65+
# Ref: https://packages.debian.org/sid/x11-utils
66+
# - `mesa-utils` for `glxgears` and `glxinfo`
67+
# Ref: https://wiki.debian.org/Mesa
68+
# - `vulkan-tools` for `vkcube` and `vulkaninfo`
69+
# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages
70+
# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu
6371
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
6472
apt-get update && apt-get install -y \
65-
git-extras \
73+
x11-apps x11-utils \
74+
mesa-utils \
75+
libgl1 vulkan-tools \
6676
&& rm -rf /var/lib/apt/lists/*
6777

78+
# Setup the required capabilities for the container runtime
79+
# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities
80+
ENV NVIDIA_VISIBLE_DEVICES=all
81+
ENV NVIDIA_DRIVER_CAPABILITIES=all
82+
83+
# Install Vulkan config files
84+
# Ref: https://gitlab.com/nvidia/container-images/vulkan
85+
RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <<EOF
86+
{
87+
"file_format_version" : "1.0.0",
88+
"ICD": {
89+
"library_path": "libGLX_nvidia.so.0",
90+
"api_version" : "1.3.194"
91+
}
92+
}
93+
EOF
94+
6895
# Install ROS2 Gazebo packages for amd64
6996
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
7097
if [ "$TARGETARCH" = "amd64" ]; then \
@@ -80,14 +107,31 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
80107
ros-$ROS_DISTRO-rviz2 \
81108
&& rm -rf /var/lib/apt/lists/*
82109

110+
USER $USERNAME
111+
112+
# Create Gazebo cache directory with correct ownership to avoid permission issues after volume mount
113+
RUN mkdir /home/$USERNAME/.gazebo
114+
115+
# Install Isaac Sim (requires Python 3.10)
116+
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
117+
# TODO: Remove the note above when it is no longer experimental
118+
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
119+
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
120+
if [ "$TARGETARCH" = "amd64" ]; then \
121+
python3 -V | grep "Python 3.10" \
122+
&& pip install isaacsim==4.1.0.0 --extra-index-url https://pypi.nvidia.com \
123+
&& pip install isaacsim-extscache-physics==4.1.0.0 isaacsim-extscache-kit==4.1.0.0 isaacsim-extscache-kit-sdk==4.1.0.0 --extra-index-url https://pypi.nvidia.com; \
124+
fi
125+
126+
# Install custom tools
127+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
128+
sudo apt-get update && sudo apt-get install -y \
129+
git-extras \
130+
&& sudo rm -rf /var/lib/apt/lists/*
131+
83132
# TODO: Add more commands here
84-
# For example, to install additional packages, uncomment the following lines and add the package names
85-
# RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
86-
# apt-get update && apt-get install -y \
87-
# $OTHER_PACKAGES \
88-
# && rm -rf /var/lib/apt/lists/*
89133
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
90-
apt-get update && apt-get install -y \
134+
sudo apt-get update && sudo apt-get install -y \
91135
# The packages below are used by the Husky repository.
92136
ros-$ROS_DISTRO-controller-manager \
93137
ros-$ROS_DISTRO-diff-drive-controller \
@@ -112,12 +156,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
112156
ros-$ROS_DISTRO-slam-toolbox \
113157
ros-$ROS_DISTRO-imu-tools \
114158
ros-$ROS_DISTRO-teleop-twist-keyboard \
115-
&& rm -rf /var/lib/apt/lists/*
116-
117-
USER $USERNAME
118-
# Create Gazebo cache directory with correct ownership to avoid permission issues after volume mount
119-
RUN mkdir /home/$USERNAME/.gazebo
120-
# TODO: Run additional commands as non-root user here
159+
&& sudo rm -rf /var/lib/apt/lists/*
121160
COPY .bashrc /home/$USERNAME/.bashrc
122161
# TODO: Copy additional files here
123162

kobuki_ws/docker/Dockerfile

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
5959
python3-pip \
6060
&& rm -rf /var/lib/apt/lists/*
6161

62-
# Install custom tools
62+
# Install GUI debugging tools
63+
# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo`
64+
# Ref: https://packages.debian.org/sid/x11-apps
65+
# Ref: https://packages.debian.org/sid/x11-utils
66+
# - `mesa-utils` for `glxgears` and `glxinfo`
67+
# Ref: https://wiki.debian.org/Mesa
68+
# - `vulkan-tools` for `vkcube` and `vulkaninfo`
69+
# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages
70+
# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu
6371
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
6472
apt-get update && apt-get install -y \
65-
git-extras \
73+
x11-apps x11-utils \
74+
mesa-utils \
75+
libgl1 vulkan-tools \
6676
&& rm -rf /var/lib/apt/lists/*
6777

78+
# Setup the required capabilities for the container runtime
79+
# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities
80+
ENV NVIDIA_VISIBLE_DEVICES=all
81+
ENV NVIDIA_DRIVER_CAPABILITIES=all
82+
83+
# Install Vulkan config files
84+
# Ref: https://gitlab.com/nvidia/container-images/vulkan
85+
RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <<EOF
86+
{
87+
"file_format_version" : "1.0.0",
88+
"ICD": {
89+
"library_path": "libGLX_nvidia.so.0",
90+
"api_version" : "1.3.194"
91+
}
92+
}
93+
EOF
94+
6895
# Install ROS2 Gazebo packages for amd64
6996
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
7097
if [ "$TARGETARCH" = "amd64" ]; then \
@@ -80,13 +107,29 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
80107
ros-$ROS_DISTRO-rviz2 \
81108
&& rm -rf /var/lib/apt/lists/*
82109

83-
# TODO: Add more commands here
84-
# For example, to install additional packages, uncomment the following lines and add the package names
85-
# RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
86-
# apt-get update && apt-get install -y \
87-
# $OTHER_PACKAGES \
88-
# && rm -rf /var/lib/apt/lists/*
110+
USER $USERNAME
111+
112+
# Create Gazebo cache directory with correct ownership to avoid permission issues after volume mount
113+
RUN mkdir /home/$USERNAME/.gazebo
114+
115+
# Install Isaac Sim (requires Python 3.10)
116+
# Note that installing Isaac Sim with pip is experimental, keep this in mind when unexpected error occurs
117+
# TODO: Remove the note above when it is no longer experimental
118+
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#installation-using-pip
119+
RUN --mount=type=cache,target=/home/user/.cache/pip,sharing=private \
120+
if [ "$TARGETARCH" = "amd64" ]; then \
121+
python3 -V | grep "Python 3.10" \
122+
&& pip install isaacsim==4.1.0.0 --extra-index-url https://pypi.nvidia.com \
123+
&& pip install isaacsim-extscache-physics==4.1.0.0 isaacsim-extscache-kit==4.1.0.0 isaacsim-extscache-kit-sdk==4.1.0.0 --extra-index-url https://pypi.nvidia.com; \
124+
fi
89125

126+
# Install custom tools
127+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
128+
sudo apt-get update && sudo apt-get install -y \
129+
git-extras \
130+
&& sudo rm -rf /var/lib/apt/lists/*
131+
132+
# TODO: Add more commands here
90133
RUN if [ "$TARGETARCH" = "arm64" ]; then \
91134
# Fix the issue of Eigen
92135
# Reference: https://gitlab.com/libeigen/eigen/-/issues/2326
@@ -98,7 +141,7 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
98141
# sudo rosdep install --from-paths src --ignore-src -y
99142
# Install these packages to avoid having to run `rosdep install` every time you build the workspace.
100143
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
101-
apt-get update && apt-get install -y \
144+
sudo apt-get update && sudo apt-get install -y \
102145
ros-$ROS_DISTRO-rviz2 \
103146
ros-$ROS_DISTRO-ros-testing \
104147
ros-$ROS_DISTRO-kobuki-velocity-smoother \
@@ -122,12 +165,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
122165
ros-$ROS_DISTRO-nav2-bringup \
123166
ros-$ROS_DISTRO-slam-toolbox \
124167
ros-$ROS_DISTRO-robot-localization \
125-
&& rm -rf /var/lib/apt/lists/*
126-
127-
USER $USERNAME
128-
# Create Gazebo cache directory with correct ownership to avoid permission issues after volume mount
129-
RUN mkdir /home/$USERNAME/.gazebo
130-
# TODO: Run additional commands as non-root user here
168+
&& sudo rm -rf /var/lib/apt/lists/*
131169
COPY .bashrc /home/$USERNAME/.bashrc
132170
# TODO: Copy additional files here
133171

0 commit comments

Comments
 (0)