How to create a Docker Image of Issac-ROS with Dockerfile

I tried to create a Docker Image of Isaac-ROS and Isaac-ROS-Apriltag by using Dockerfile.
However, I encounted several errors one after another.
Here is the Dockerfile I wrote.

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

RUN apt-get update && apt-get install -y \
    python3-pip \
    build-essential \
    cmake \
    git \
    libopencv-dev \
    git-lfs \
    ros-humble-isaac-ros-apriltag \
    ros-humble-tf-transformations \
    ros-humble-ament-cmake-auto \
    ros-humble-ament-cmake-core \
    ros-humble-ament-cmake \
    ros-humble-ament-cmake-test \
    python3-ament-package

RUN git lfs install

RUN pip3 install transforms3d

ENV RCUTILS_LOGGING_OUTPUT_STREAM=both

WORKDIR /workspaces/isaac_ros-dev

COPY ./src /workspaces/isaac_ros-dev/src
COPY ./mtmc_client.py /workspaces/isaac_ros-dev/mtmc_client.py
COPY ./camera_settings.yaml /workspaces/isaac_ros-dev/camera_settings.yaml
COPY ./apriltag_world_coordinates_list.yaml /workspaces/isaac_ros-dev/apriltag_world_coordinates_list.yaml

ENV CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/opt/ros/humble

RUN rosdep update && \
    rosdep install --from-paths src --ignore-src -r -y

RUN cd /workspaces/isaac_ros-dev && \
    colcon build --symlink-install --packages-skip usb_cam

CMD ["bash", "-c", "source /workspaces/isaac_ros-dev/install/setup.bash && exec bash"]

Would you please teach me how I should write a Dockerfile to create a Docker Image of Isaac-ROS?

Thanks.

Hi @uma7

It’s pretty simple.

First step follow the documentation starting from here: Isaac ROS Dev — isaac_ros_docs documentation

Starting from your docker, like the example

ARG BASE_IMAGE
FROM ${BASE_IMAGE}

... steps ...

COPY myfile.txt /myfile.txt

... more steps ...

You can install, like the demo, the Apriltag node, like:

sudo apt-get install -y ros-humble-isaac-ros-apriltag

Best,
Raffaello

@Raffaello
Thank you for your reply and infomation, Raffaello.
I am supposed to send and share a Docker Image of Isaac-ROS on my computer to my team.
Then my team leader said “Create a docker image with Dockerfile, do not use docker save.”
Is there any way to create Isaac-ROS docker image using Dockerfile?
Like I wrote, I tried to write a Dockerfile, but I encountered errors one after another, especially the part of colcon build.
Maybe FROM nvcr.io/nvidia/isaac/ros:x86_64-ros2_humble_45d368cdbbe4a484643464d0d492c764 is not correct.

BTW, I am curious about the way you advised using run_dev.sh.
I tried but I could not understand the document.
Am I supposed to do following these?

  • git clone Isaac-ROS-common
  • run $PATH_TO_ISAAC_ROS_COMMON/scripts/run_dev.sh -d $PATH_TO_ROS_WORKSPACE
  • create a file, .isaac_ros_common-config
  • create another file, Dockerfile.mine
  • Finally, run PATH_TO_ISAAC_ROS_COMMON/scripts/docker_deploy.sh --base_image_key "aarch64.ros2_humble" .......... --name "my_docker_registry.io/myimage"

Thank you.

yes, exactly Isaac ROS Dev — isaac_ros_docs documentation

You can install all Isaac ROS packages from binaries without compiling anything and save time.

Raffaello