@@ -67,7 +67,7 @@ RUN groupadd realtime && \
6767# hadolint ignore=SC1091
6868RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
6969 --mount=type=cache,target=/var/lib/apt,sharing=locked \
70- --mount=type=bind,target=${USER_WS}/,source=. \
70+ --mount=type=bind,target=${USER_WS}/src ,source=./src \
7171 . /opt/overlay_ws/install/setup.sh && \
7272 apt-get update && \
7373 rosdep install -q -y \
@@ -105,139 +105,11 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
105105 less \
106106 gdb \
107107 nano \
108- tmux
108+ tmux
109109
110110# Set up the user's .bashrc file and shell.
111111CMD ["/usr/bin/bash" ]
112112
113-
114- # #################################################
115- # Starting from the specified MoveIt Pro release with CUDA GPU #
116- # #################################################
117- # The image tag is specified in the argument itself.
118- # hadolint ignore=DL3006
119- FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base-gpu
120-
121- # Create a non-root user
122- ARG USERNAME
123- ARG USER_UID
124- ARG USER_GID
125-
126- # hadolint ignore=DL3008
127- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
128- --mount=type=cache,target=/var/lib/apt,sharing=locked \
129- apt-get update && apt-get install wget -y -q --no-install-recommends && \
130- wget --progress=dot:giga https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \
131- dpkg -i cuda-keyring_1.1-1_all.deb && \
132- apt-get update && \
133- apt-get install -q -y --no-install-recommends \
134- libcudnn9-cuda-12 \
135- libcudnn9-dev-cuda-12 \
136- libcublas-12-6 \
137- cuda-cudart-12-6 \
138- libcurand-12-6 \
139- libcufft-12-6 \
140- libnvinfer10 \
141- libnvinfer-plugin10 \
142- libnvonnxparsers10 \
143- libtree
144-
145- # Misleading name: onnxruntime_gpu is actually specifically the CUDA package. This is only shipped for x86-64
146- RUN if [ "$(uname -m)" = "x86_64" ]; then pip3 install --no-cache-dir onnxruntime_gpu==1.19.0; fi
147-
148- # Copy source code from the workspace's ROS 2 packages to a workspace inside the container
149- ARG USER_WS=/home/${USERNAME}/user_ws
150- ENV USER_WS=${USER_WS}
151-
152- # Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root
153- WORKDIR $USER_WS
154- # hadolint ignore=DL3008
155- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
156- --mount=type=cache,target=/var/lib/apt,sharing=locked \
157- groupadd --gid $USER_GID ${USERNAME} && \
158- useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash --create-home ${USERNAME} && \
159- apt-get update && \
160- apt-get install -q -y --no-install-recommends sudo && \
161- echo ${USERNAME} ALL=\( root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} && \
162- chmod 0440 /etc/sudoers.d/${USERNAME} && \
163- cp -r /etc/skel/. /home/${USERNAME} && \
164- mkdir -p \
165- /home/${USERNAME}/.ccache \
166- /home/${USERNAME}/.config \
167- /home/${USERNAME}/.ignition \
168- /home/${USERNAME}/.colcon \
169- /home/${USERNAME}/.ros && \
170- chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/
171-
172- # Install additional dependencies
173- # You can also add any necessary apt-get install, pip install, etc. commands at this point.
174- # NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file.
175- # hadolint ignore=SC1091
176- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
177- --mount=type=cache,target=/var/lib/apt,sharing=locked \
178- --mount=type=bind,target=${USER_WS}/,source=. \
179- . /opt/overlay_ws/install/setup.sh && \
180- apt-get update && \
181- rosdep install -q -y \
182- --from-paths src \
183- --ignore-src
184-
185- # Set up colcon defaults for the new user
186- USER ${USERNAME}
187- RUN colcon mixin add default \
188- https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
189- colcon mixin update && \
190- colcon metadata add default \
191- https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
192- colcon metadata update
193- COPY colcon-defaults.yaml /home/${USERNAME}/.colcon/defaults.yaml
194-
195- # hadolint ignore=DL3002
196- USER root
197-
198- # Set up the user's .bashrc file and shell.
199- CMD ["/usr/bin/bash" ]
200-
201- # ##################################################################
202- # Target for the developer build which does not compile any code. #
203- # ##################################################################
204- FROM base-gpu AS user-overlay-gpu-dev
205-
206- ARG USERNAME
207- ARG USER_WS=/home/${USERNAME}/user_ws
208- ENV USER_WS=${USER_WS}
209-
210- # Install any additional packages for development work
211- # hadolint ignore=DL3008
212- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
213- --mount=type=cache,target=/var/lib/apt,sharing=locked \
214- apt-get update && \
215- apt-get install -y --no-install-recommends \
216- less \
217- gdb \
218- nano
219-
220- # Set up the user's .bashrc file and shell.
221- CMD ["/usr/bin/bash" ]
222-
223- # ########################################
224- # Target for compiled, deployable image with GPU support #
225- # ########################################
226- FROM base-gpu AS user-overlay-gpu
227-
228- ARG USERNAME
229- ARG USER_WS=/home/${USERNAME}/user_ws
230- ENV USER_WS=${USER_WS}
231-
232- 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
233-
234- # Compile the workspace
235- WORKDIR $USER_WS
236-
237- # Set up the user's .bashrc file and shell.
238- CMD ["/usr/bin/bash" ]
239-
240-
241113# ########################################
242114# Target for compiled, deployable image #
243115# ########################################
0 commit comments