Cannot build ROS2 Docker container on the Jetson Nano


I tried to build the ROS2 docker container ros:foxy-ros-base on my jetson nano after making some changes to the docker file so that I could add some python libraries to my docker container. I have edited the docker file and built the container to add python libraries before using jetson-containers build ros:foxy-ros-base a few times, however now when I try to do this I get to 100% and then get the following error message:

Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/in_process/", line 363, in <module> main() File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/in_process/", line 345, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/in_process/", line 262, in build_wheel metadata_directory) File "/usr/local/lib/python3.6/dist-packages/setuptools/", line 231, in build_wheel wheel_directory, config_settings) File "/usr/local/lib/python3.6/dist-packages/setuptools/", line 215, in _build_with_temp_dir self.run_setup() File "/usr/local/lib/python3.6/dist-packages/setuptools/", line 268, in run_setup self).run_setup(setup_script=setup_script) File "/usr/local/lib/python3.6/dist-packages/setuptools/", line 158, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "", line 541, in <module> main() File "", line 314, in main cmake_source_dir=cmake_source_dir, File "/tmp/pip-build-env-4_4wsjoz/overlay/lib/python3.6/site-packages/skbuild/", line 683, in setup cmake_install_dir, File "", line 454, in _classify_installed_files_override raise Exception("Not found: '%s'" % relpath_re) Exception: Not found: 'python/cv2/mat_wrapper/.*\.py' Building wheel for opencv-contrib-python (pyproject.toml): finished with status 'error' ERROR: Failed building wheel for opencv-contrib-python Failed to build opencv-contrib-python ERROR: Failed to build one or more wheels The command '/bin/sh -c /tmp/opencv/ &&     pip3 install --no-cache-dir 	 opencv-contrib-python~=${OPENCV_VERSION}     || /tmp/opencv/' returned a non-zero code: 1 Traceback (most recent call last): File "/usr/lib/python3.6/", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.6/", line 85, in _run_code exec(code, run_globals) File "/home/team9jetson/jetson-containers/jetson_containers/", line 103, in <module> build_container(, args.packages, args.base, args.build_flags, args.simulate, args.skip_tests, args.test_only, args.push, args.no_github_api) File "/home/team9jetson/jetson-containers/jetson_containers/", line 143, in build_container status =, ' '), executable='/bin/bash', shell=True, check=True)   File "/usr/lib/python3.6/", line 438, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command 'DOCKER_BUILDKIT=0 docker build --network=host --tag ros:foxy-ros-base-l4t-r32.7.4-opencv --file /home/team9jetson/jetson-containers/packages/opencv/Dockerfile.pip --build-arg BASE_IMAGE=ros:foxy-ros-base-l4t-r32.7.4-numpy --build-arg OPENCV_VERSION="4.5.0" --build-arg OPENCV_PYTHON="4.x" --build-arg CUDA_ARCH_BIN="5.3,6.2,7.2" /home/team9jetson/jetson-containers/packages/opencv 2>&1 | tee /home/team9jetson/jetson-containers/logs/20240421_161329/build/ros_foxy-ros-base-l4t-r32.7.4-opencv.txt; exit ${PIPESTATUS[0]}' returned non-zero exit status 1.

I tried adding RUN apt-get update && apt-get install -y \ libopencv-dev=3.2.0+dfsg-4ubuntu0.1 before is run in the dockerfile but this made no difference. Can anyone advise on this please?

Please refer to About the process of building ROS2 docker container in Jetson nano devkit (jp4.5.1) - Jetson & Embedded Systems / Jetson Nano - NVIDIA Developer Forums to see if can help. Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.