Rebuild the Docker Container for Isaac ROS

Hey there

I’m relatively new to docker containers, so apologies if this is too obvious. I’ve been following this guide:

https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_common/index.html

I needed to add a couple of extra dependencies to the existing docker container. Therefore I added the following (commented) to Dockerfile.ros2_humble:

Install additional ROS packages

RUN apt-get update && apt-get install -y
ros-humble-camera-info-manager
ros-humble-rosbag2
ros-humble-hardware-interface \ # added this line for hardware interface
ros-humble-xacro \ # <— Add this line for xacro
ros-humble-rosbag2-compression-zstd
ros-humble-rosbag2-cpp
ros-humble-rosbag2-py
ros-humble-rosbridge-suite
ros-humble-rqt-graph
ros-humble-rqt-reconfigure
ros-humble-rviz-common
ros-humble-rviz-default-plugins
&& rm -rf /var/lib/apt/lists/*
&& apt-get clean

However, these don’t seem to update the actual running docker container. I did some further reading, and it would seem that I need to rebuild the docker image. (Let me know if I’m not on the right track). So I tried the following:

chris@ubuntu:~/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts$ ./build_base_image.sh ros2_humble.realsense
Target image name not specified, using ros2_humble-realsense-image
chris@ubuntu:~/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts$ ./build_base_image.sh ros2_humble.realsense-image
Target image name not specified, using ros2_humble-realsense-image-image
chris@ubuntu:~/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts$ ./build_base_image.sh
target image not specified
chris@ubuntu:~/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts$ ./build_base_image.sh ros2_humble.realsense
Target image name not specified, using ros2_humble-realsense-image
chris@ubuntu:~/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts$ ./build_base_image.sh ros2_humble.realsense
Target image name not specified, using ros2_humble-realsense-image
chris@ubuntu:~/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts$ ./build_base_image.sh aarch64.ros2_humble.realsense.user
Target image name not specified, using aarch64-ros2_humble-realsense-user-image

These don’t move anything forward, and there’s no building of a container happening. Is there any further command that I need to specify?

If I build a new container, does it result in a new run_dev.sh file?

I do have a .isaac_ros_common-config file in my scripts folder.
It contains the following: CONFIG_IMAGE_KEY=ros2_humble.realsense

Any assistance is appreciated.

1 Like

Hi @c4turner ,

We updated our Docker just tonight with the new release of Isaac ROS 2.1
Release note: Release Notes — isaac_ros_docs documentation

I want to highlight this new update in particular.

  • Streamlined developer experience with prebuilt Debian packages for Isaac ROS on x86 and Jetson platforms

If you haven’t heard of the NVIDIA build farm, I recommend watching this documentation as well.
https://nvidia-isaac-ros.github.io/getting_started/isaac_ros_buildfarm_cdn.html

Best,
Raffaello

I updated to the latest version of Isaac, without improvement.

The page below, regarding configuring the developer environment doesn’t actually cover the above question, and the docker script system that was developed is really very robust, so I want to avoid building my own dockerfile from scratch.

https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_common/index.html#isaac-ros-docker-development-environment

I should be able to add a few lines to the Dockerfile.ros2_humble, and it impact the entire workspace using the run_dev.sh sequence.

docker system prune -a

The above, very heavy handed approach to the docker container cleared everything out of cache, allows a rebuild, but it doesn’t fix the problem! So adding the ros-humble-xacro dependency to the Dockerfile.ros2_humble doesn’t get me anywhere. I’m at a loss for how changing the source file doesn’t result in a solution to to problem.

Is something going on behind the scenes that I’m not realizing? RVIZ seems to work, which is build using that same file.

Any suggestions would be appreciated. I’ve been working through this problem for several hours.

@c4turner , the issue here is that the additional lines you added to Dockerfile.ros2_humble are not getting picked up because of the existence of the file Dockerfile.x86_64.ros2_humble (or Dockerfile.aarch64.ros2_humble). The run_dev.sh script finds this Dockerfile through its image key suffix being a better match and this pulls down our prebuilt Isaac ROS Dev base image. If you want to add lines to Dockerfile.ros2_humble and see them reflected, just delete the file Dockerfile.x86_64.ros2_humble (or Dockerfile.aarch64.ros2_humble) and run_dev.sh will rebuild all of the image layers from scratch (should not take too long because ROS 2 is installed prebuilt from the NVIDIA ROS 2 Buildfarm).

Alternatively, if you want, you can add your own Dockerfile.mystuff in isaac_ros_common/docker and then update your default image key to include it by creating a .isaac_ros_common-config file in isaac_ros_common/scripts as detailed here.

Ah, understood.

I didn’t realize that the Dockerfil.aarch64.ros2_humble was being utilized in the build. When looking at the build, i assumed it was using Dockerfile.aarch64, that I had downloaded, along with Dockerfile.ros2_humble.

Is there a benefit to using the Dockerfile pulled from Nvidia (aarch64.ros2_humble), instead of the local aarch64, and ros2_humble files respectively.

I take it the only way to truly differentiate these is to delete whichever files you decide not to use.

my docker build is now as follows:

chris@ubuntu:~/workspaces/isaac_ros-dev/src/isaac_ros_common$ cd ~/workspaces/isaac_ros-dev/src/isaac_ros_common && ./scripts/run_dev.sh
isaac_ros_dev not specified, assuming /home/chris/workspaces/isaac_ros-dev
Error: Failed to call git rev-parse --git-dir: exit status 128
Building aarch64.aarch64.ros2_humble.realsense.user.florence base as image: isaac_ros_dev-aarch64 using key aarch64.aarch64.ros2_humble.realsense.user.florence
Using configured docker search paths: /home/chris/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/workspaces/isaac_ros-dev/ros_ws/docker /home/chris/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/…/docker
Using base image name not specified, using ‘’
Using docker context dir not specified, using Dockerfile directory
Resolved the following Dockerfiles for target image: aarch64.aarch64.ros2_humble.realsense.user.florence
/home/chris/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/…/docker/Dockerfile.florence
/home/chris/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/…/docker/Dockerfile.user
/home/chris/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/…/docker/Dockerfile.realsense
/home/chris/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/…/docker/Dockerfile.aarch64.ros2_humble
/home/chris/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/…/docker/Dockerfile.aarch64
Building /home/chris/workspaces/isaac_ros-dev/src/isaac_ros_common/scripts/…/docker/Dockerfile.aarch64 as image: aarch64-image with base:

Notice specifically that by putting in the CONFIG_IMAGE_KEY, aarch64, it’s now pulling both the local file, and the NVIDIA remote file. Hopefully that’s okay, though if it turns out it’s not, I can always delete a file.

Hi @c4turner ,

As @hemals suggested in their post, we recommend creating a new docker and adding all drivers and software there instead of modifying ours.
You can check our documentation to know how you can make it one: Isaac ROS Common — isaac_ros_docs documentation

Another way to rebuild the docker image without cloning the container from the ngc repository is to cancel this file https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common/blob/main/docker/Dockerfile.aarch64.ros2_humble
and clean the docker images downloaded from your device.
You will force the script to build all images from scratch, and your modified file will finally be built.

on Nov 29 @hemals mentioned that you can add your own Dockerfile under workspaces/isaac_ros-dev/src/isaac_ros_common/docker, but in the the link you posted on Dec 6 https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_common/index.html#configuring-run-dev-sh the instructions mention placing it under workspaces/isaac_ros-dev/docker. Are both valid or should one be used over the other?

Thanks