66#
77
88# Specify the MoveIt Pro release to build on top of.
9- ARG MOVEIT_STUDIO_BASE_IMAGE
10- ARG USERNAME=studio -user
9+ ARG MOVEIT_PRO_BASE_IMAGE=picknikciuser/moveit-studio:${MOVEIT_DOCKER_TAG:-main}-${MOVEIT_ROS_DISTRO:-humble}
10+ ARG USERNAME=moveit-pro -user
1111ARG USER_UID=1000
1212ARG USER_GID=1000
1313
@@ -16,7 +16,7 @@ ARG USER_GID=1000
1616# #################################################
1717# The image tag is specified in the argument itself.
1818# hadolint ignore=DL3006
19- FROM ${MOVEIT_STUDIO_BASE_IMAGE } AS base
19+ FROM ${MOVEIT_PRO_BASE_IMAGE } AS base
2020
2121# Create a non-root user
2222ARG USERNAME
@@ -27,6 +27,12 @@ ARG USER_GID
2727ARG USER_WS=/home/${USERNAME}/user_ws
2828ENV USER_WS=${USER_WS}
2929
30+ # Set real time limits
31+ # Ensure the directory exists
32+ RUN mkdir -p /etc/security
33+ # Copy the custom limits configuration into the container
34+ COPY src/moveit_pro_franka_configs/franka_arm_hw/config/rt_limits.conf /etc/security/limits.conf
35+
3036# Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root
3137WORKDIR $USER_WS
3238# hadolint ignore=DL3008
@@ -51,13 +57,17 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
5157# Add user to video group to enable communication with cameras
5258RUN usermod -aG dialout,video ${USERNAME}
5359
60+ # Add user to the realtime group to enable RT limits
61+ RUN groupadd realtime && \
62+ usermod -a -G realtime ${USERNAME}
63+
5464# Install additional dependencies
5565# You can also add any necessary apt-get install, pip install, etc. commands at this point.
5666# NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file.
5767# hadolint ignore=SC1091
5868RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
5969 --mount=type=cache,target=/var/lib/apt,sharing=locked \
60- --mount=type=bind,target=${USER_WS}/,source=. \
70+ --mount=type=bind,target=${USER_WS}/src ,source=./src \
6171 . /opt/overlay_ws/install/setup.sh && \
6272 apt-get update && \
6373 rosdep install -q -y \
@@ -94,7 +104,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
94104 apt-get install -y --no-install-recommends \
95105 less \
96106 gdb \
97- nano
107+ nano \
108+ tmux
98109
99110# Set up the user's .bashrc file and shell.
100111CMD ["/usr/bin/bash" ]
@@ -113,129 +124,3 @@ WORKDIR $USER_WS
113124
114125# Set up the user's .bashrc file and shell.
115126CMD ["/usr/bin/bash" ]
116-
117- # #################################################
118- # Starting from the specified MoveIt Pro release with CUDA GPU #
119- # #################################################
120- # The image tag is specified in the argument itself.
121- # hadolint ignore=DL3006
122- FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base-gpu
123-
124- # Create a non-root user
125- ARG USERNAME
126- ARG USER_UID
127- ARG USER_GID
128-
129- # hadolint ignore=DL3008
130- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
131- --mount=type=cache,target=/var/lib/apt,sharing=locked \
132- apt-get update && apt-get install wget -y -q --no-install-recommends && \
133- wget --progress=dot:giga https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \
134- dpkg -i cuda-keyring_1.1-1_all.deb && \
135- apt-get update && \
136- apt-get install -q -y --no-install-recommends \
137- libcudnn9-cuda-12 \
138- libcudnn9-dev-cuda-12 \
139- libcublas-12-6 \
140- cuda-cudart-12-6 \
141- libcurand-12-6 \
142- libcufft-12-6 \
143- libnvinfer10 \
144- libnvinfer-plugin10 \
145- libnvonnxparsers10 \
146- libtree
147-
148- # Misleading name: onnxruntime_gpu is actually specifically the CUDA package. This is only shipped for x86-64
149- RUN if [ "$(uname -m)" = "x86_64" ]; then pip3 install --no-cache-dir onnxruntime_gpu==1.19.0; fi
150-
151- # Copy source code from the workspace's ROS 2 packages to a workspace inside the container
152- ARG USER_WS=/home/${USERNAME}/user_ws
153- ENV USER_WS=${USER_WS}
154-
155- # Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root
156- WORKDIR $USER_WS
157- # hadolint ignore=DL3008
158- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
159- --mount=type=cache,target=/var/lib/apt,sharing=locked \
160- groupadd --gid $USER_GID ${USERNAME} && \
161- useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash --create-home ${USERNAME} && \
162- apt-get update && \
163- apt-get install -q -y --no-install-recommends sudo && \
164- echo ${USERNAME} ALL=\( root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} && \
165- chmod 0440 /etc/sudoers.d/${USERNAME} && \
166- cp -r /etc/skel/. /home/${USERNAME} && \
167- mkdir -p \
168- /home/${USERNAME}/.ccache \
169- /home/${USERNAME}/.config \
170- /home/${USERNAME}/.ignition \
171- /home/${USERNAME}/.colcon \
172- /home/${USERNAME}/.ros && \
173- chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/
174-
175- # Install additional dependencies
176- # You can also add any necessary apt-get install, pip install, etc. commands at this point.
177- # NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file.
178- # hadolint ignore=SC1091
179- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
180- --mount=type=cache,target=/var/lib/apt,sharing=locked \
181- --mount=type=bind,target=${USER_WS}/,source=. \
182- . /opt/overlay_ws/install/setup.sh && \
183- apt-get update && \
184- rosdep install -q -y \
185- --from-paths src \
186- --ignore-src
187-
188- # Set up colcon defaults for the new user
189- USER ${USERNAME}
190- RUN colcon mixin add default \
191- https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
192- colcon mixin update && \
193- colcon metadata add default \
194- https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
195- colcon metadata update
196- COPY colcon-defaults.yaml /home/${USERNAME}/.colcon/defaults.yaml
197-
198- # hadolint ignore=DL3002
199- USER root
200-
201- # Set up the user's .bashrc file and shell.
202- CMD ["/usr/bin/bash" ]
203-
204- # ##################################################################
205- # Target for the developer build which does not compile any code. #
206- # ##################################################################
207- FROM base-gpu AS user-overlay-gpu-dev
208-
209- ARG USERNAME
210- ARG USER_WS=/home/${USERNAME}/user_ws
211- ENV USER_WS=${USER_WS}
212-
213- # Install any additional packages for development work
214- # hadolint ignore=DL3008
215- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
216- --mount=type=cache,target=/var/lib/apt,sharing=locked \
217- apt-get update && \
218- apt-get install -y --no-install-recommends \
219- less \
220- gdb \
221- nano
222-
223- # Set up the user's .bashrc file and shell.
224- CMD ["/usr/bin/bash" ]
225-
226- # ########################################
227- # Target for compiled, deployable image with GPU support #
228- # ########################################
229- FROM base-gpu AS user-overlay-gpu
230-
231- ARG USERNAME
232- ARG USER_WS=/home/${USERNAME}/user_ws
233- ENV USER_WS=${USER_WS}
234-
235- ENV LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/onnxruntime/capi:/usr/lib/x86_64-linux-gnu:/usr/local/cuda-12.6/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
236-
237- # Compile the workspace
238- WORKDIR $USER_WS
239-
240- # Set up the user's .bashrc file and shell.
241- CMD ["/usr/bin/bash" ]
0 commit comments