The Dockerfile.orin has grown organically and accumulates redundant installations. Running rosdep install in the final stage may reinstall packages already present from earlier stages, and the dependency list across the three stages (nvidia-realsense, reseq-base, reseq) is not well organised.
Current problems
- The
reseq-base stage installs a long list of ROS packages (MoveIt, ros2_control, SLAM, rosbridge, etc.) via apt, then the final reseq stage runs rosdep install --from-path src which may re-resolve and attempt to install some of the same packages — wasting build time
- Multiple
apt update calls across the Dockerfile that could be consolidated
numpy==1.23.5 is installed twice (once after PyTorch, once after opencv-contrib-python)
- Dependencies are scattered — some ROS packages are in
reseq-base, others come in via rosdep in the final stage. It's unclear which are intentional pre-installs vs. redundant
- Utility tools (
ranger, nano, iproute2, usbutils) are mixed in with runtime dependencies
- No cleanup of apt caches in some stages (some
RUN blocks don't end with rm -rf /var/lib/apt/lists/*)
What needs to happen
- Audit the
reseq-base apt installs against what rosdep install resolves from the workspace package.xml files — remove anything from reseq-base that rosdep will handle anyway in the final stage
- Consolidate the scattered pip installs (numpy, opencv-contrib-python, Jetson.GPIO, etc.) into fewer
RUN layers
- Separate dev/debug tools (
ranger, nano, rqt*, rviz2) so they can be easily excluded for a slimmer production image
- Ensure all
apt-get calls clean up caches (rm -rf /var/lib/apt/lists/*) to reduce image size
Relevant files
- Dockerfile:
src/docker/Dockerfile.orin (423 lines, 3 stages)
- Docker compose:
src/docker/docker-compose.yaml
- Entrypoint:
src/docker/utils/ros_entrypoint.sh
- Package XMLs:
src/*/package.xml (define what rosdep resolves)
- Dockerfile.orin docs
Documentation
After cleanup, update:
The
Dockerfile.orinhas grown organically and accumulates redundant installations. Runningrosdep installin the final stage may reinstall packages already present from earlier stages, and the dependency list across the three stages (nvidia-realsense,reseq-base,reseq) is not well organised.Current problems
reseq-basestage installs a long list of ROS packages (MoveIt, ros2_control, SLAM, rosbridge, etc.) viaapt, then the finalreseqstage runsrosdep install --from-path srcwhich may re-resolve and attempt to install some of the same packages — wasting build timeapt updatecalls across the Dockerfile that could be consolidatednumpy==1.23.5is installed twice (once after PyTorch, once after opencv-contrib-python)reseq-base, others come in viarosdepin the final stage. It's unclear which are intentional pre-installs vs. redundantranger,nano,iproute2,usbutils) are mixed in with runtime dependenciesRUNblocks don't end withrm -rf /var/lib/apt/lists/*)What needs to happen
reseq-baseapt installs against whatrosdep installresolves from the workspacepackage.xmlfiles — remove anything fromreseq-basethatrosdepwill handle anyway in the final stageRUNlayersranger,nano,rqt*,rviz2) so they can be easily excluded for a slimmer production imageapt-getcalls clean up caches (rm -rf /var/lib/apt/lists/*) to reduce image sizeRelevant files
src/docker/Dockerfile.orin(423 lines, 3 stages)src/docker/docker-compose.yamlsrc/docker/utils/ros_entrypoint.shsrc/*/package.xml(define whatrosdepresolves)Documentation
After cleanup, update: