Deploy Isaac ROS packages via docker image

I am trying to provide docker images for deployment of a set of custom packages that depend on the Isaac ROS packages - isaac_ros_common, isaac_ros_tensor_rt etc.

I would like to provide the docker image with all ros packages compiled.

Initially I tried something similar to how other packages are built in Dockerfile.ros2_humble such as nav2

# Copy CUDA libraries
COPY test/lib/libcusolver.so.11 /usr/local/cuda-11.4/targets/aarch64-linux/lib/libcusolver.so.11 
COPY test/lib/libcusparse.so.11 /usr/local/cuda-11.4/targets/aarch64-linux/lib/libcusparse.so.11
COPY test/lib/libcurand.so.10 /usr/local/cuda-11.4/targets/aarch64-linux/lib/libcurand.so.10
COPY test/lib/libnvToolsExt.so /usr/local/cuda-11.4/targets/aarch64-linux/lib/libnvToolsExt.so
COPY test/lib/libcupti.so.11.4 /usr/local/cuda-11.4/targets/aarch64-linux/lib/libcupti.so.11.4
COPY test/lib/libcudla.so.1 /usr/local/cuda-11.4/targets/aarch64-linux/lib/libcudla.so.1
COPY test/include/nvToolsExt.h /usr/local/cuda-11.4/targets/aarch64-linux/include/nvToolsExt.h
COPY jetson_multimedia_api /usr/src/jetson_multimedia_api           
# COPY aarch64-linux-gnu /opt/nvidia/vpi2/lib/aarch64-linux-gnu

# Install isaac-ros packages
RUN apt-get update && mkdir -p ${ROS_ROOT}/src && cd ${ROS_ROOT}/src \
    && git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common.git && cd isaac_ros_common && git checkout 94dfe8dcc64a2cd3e8f1d50cf05de1e1ab1e9c8b \
    && git lfs fetch && git lfs checkout && cd .. \
    && git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_image_pipeline.git && cd isaac_ros_image_pipeline && git checkout 6e498440163f65596e6cc58b37b6cef50336afec \
    && git lfs fetch && git lfs checkout && cd .. \
    && git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros.git && cd isaac_ros_nitros && git checkout 2d35cacf6b57abbb37ea8ae769d8661b1970c8e7 \
    && git lfs fetch && git lfs checkout && cd .. \
    && source ${ROS_ROOT}/setup.bash && cd ${ROS_ROOT} \
    && rosdep install -y -r --ignore-src --from-paths src --rosdistro ${ROS_DISTRO} \
    && colcon build --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to-regex isaac_ros* --packages-ignore isaac_ros_to_h264_msgs_packet isaac_ros_stereo_image_proc isaac_ros_triton \
    && rm -Rf src build log \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

However this required DOCKER_BUILDKIT=0 when building, and when running the packages it doesn’t work anyway…

Is there any valid method to providing a prebuilt isaac ros environment with a docker image?

Hi @tom_grimwood

Thank you for writing here. I suggest to build a docker image, starting from the image:

X86_64

FROM nvcr.io/nvidia/isaac/ros:x86_64-ros2_humble_bcf535ea3b9d16a854aaeb1701ab5a86

or Jetson

FROM nvcr.io/nvidia/isaac/ros:aarch64-ros2_humble_b7e1ed6c02a6fa3c1c7392479291c035

and simply install from apt-get the isaac-ros packages, such an example, you can build this image without compiling from scratch all Isaac ROS packages

FROM nvcr.io/nvidia/isaac/ros:x86_64-ros2_humble_bcf535ea3b9d16a854aaeb1701ab5a86
RUN sudo apt-get update && \
    sudo apt-get install -y ros-humble-image-pipeline

Let me know if it helps you to build your image quickly.

Best,
Raffaello

Thanks, I was trying to find a way to do it without upgrading to Jetpack 5.1.2, but I caved in the end and this works great.

This is what it looked like in the end

FROM nvcr.io/nvidia/isaac/ros:aarch64-ros2_humble_b7e1ed6c02a6fa3c1c7392479291c035

# Setup non-root admin user
ARG USERNAME
ARG USER_UID=1000
ARG USER_GID=1000

# disable terminal interaction for apt
ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL /bin/bash
SHELL ["/bin/bash", "-c"]

# Env setup
RUN locale-gen en_US en_US.UTF-8
RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV ROS_PYTHON_VERSION=3
ENV ROS_DISTRO=humble
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO}

# Install Isaac ROS packages
RUN apt-get update && apt-get install -y \ 
    ros-humble-isaac-ros-common \
    ros-humble-isaac-ros-dnn-image-encoder \
    ros-humble-isaac-ros-tensor-rt \
    ros-humble-isaac-ros-h264-decoder \
    ros-humble-isaac-ros-image-pipeline \
    ros-humble-isaac-ros-nitros \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get clean
1 Like