Unable to build ZED ROS2 packages in docker container build

I am getting errors attempting to build the ZED ROS2 packages in a dockerfile. The base image is Jetpack 35.1.0 w/ ROS2 Foxy. The ZED SDK is installed prior to colcon building the ZED ROS2 packages, but I get the following errors when building the workspace packages. If I omit the colcon build from my dockerfile, and run it in the container no errors occur. Any thoughts why the docker image build would fail building these packages, but building in the running container would not?

The errors…

#6 550.7 Finished <<< zed_components [2min 59s]
#6 550.7 Starting >>> zed_wrapper
#6 550.8 Starting >>> zed_rgb_convert
#6 578.4 — stderr: zed_wrapper
#6 578.4 /usr/bin/ld: warning: libcuda.so.1, needed by /usr/local/zed/lib/libsl_zed.so, not found (try using -rpath or -rpath-link)
#6 578.4 /usr/bin/ld: warning: libnvbuf_utils.so.1.0.0, needed by /usr/local/zed/lib/libsl_zed.so, not found (try using -rpath or -rpath-link)
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuCtxPushCurrent_v2' #6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to NvBufferMemMap’
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuStreamSynchronize' #6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to NvBufferMemUnMap’
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuCtxPopCurrent_v2' #6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to NvBufferMemSyncForDevice’
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuCtxSetCurrent' #6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuCtxCreate_v2’
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to NvBufferGetParams' #6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to NvBufferDestroy’
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to NvBufferCreateEx' #6 578.4 /usr/bin/ld: /home/ros/ros2bot_ws/install/zed_components/lib/libzed_camera_component.so: undefined reference to cuCtxGetDevice’
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuGetErrorName' #6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to NvBufferTransform’
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuMemcpy2DAsync_v2' #6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuCtxDestroy_v2’
#6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to NvBufferMemSyncForCpu' #6 578.4 /usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to cuCtxGetCurrent’
#6 578.4 collect2: error: ld returned 1 exit status
#6 578.4 make[2]: *** [CMakeFiles/zed_wrapper.dir/build.make:291: zed_wrapper] Error 1
#6 578.4 make[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/zed_wrapper.dir/all] Error 2
#6 578.4 make: *** [Makefile:146: all] Error 2
#6 578.4 —
#6 578.4 Failed <<< zed_wrapper [27.7s, exited with code 2]
#6 596.1 Aborted <<< zed_rgb_convert [45.3s]
#6 596.5
#6 596.5 Summary: 19 packages finished [9min 49s]
#6 596.5 1 package failed: zed_wrapper
#6 596.5 1 package aborted: zed_rgb_convert
#6 596.5 5 packages had stderr output: sllidar_ros2 zed_rgb_convert zed_topic_benchmark zed_topic_benchmark_component zed_wrapper
#6 596.5 3 packages not processed

I have searched for the libcuda.so.1 and 'libnvbuf_utils.so.1.0.0 libraries… They are found in the ‘/usr/lib/aarch64-linux-gnu/tegra/’ directory.

ros@jetson-nx:/usr/lib$ echo $LD_LIBRARY_PATH #path
/opt/ros/foxy/opt/yaml_cpp_vendor/lib:/opt/ros/foxy/opt/rviz_ogre_vendor/lib:/opt/ros/foxy/lib/aarch64-linux-gnu:/opt/ros/foxy/lib
ros@jetson-nx:/usr/lib$ sudo find /usr/ -name ‘libcuda.so.#version
/usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1.1
/usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1
ros@jetson-nx:/usr/lib$ sudo find /usr/ -name 'libnvbuf_utils.so.
#version
/usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so.1.0.0
ros@jetson-nx:/usr/lib$

Hi @abcampbellb
Welcome to the Stereolabs community

You are using as base a Docker image not correct.
We provide a ready dockerfile for L4T 35.1 and ROS2 Humble, you can use it as an example to create yours: