I am trying to build l4t-jetpack docker image for r36.2.0 based on the provided dockerfile replacing the dev packages with runtime packages and avoiding building the corresponding opencv and tensorrt packages. The final dockerfile I use is:
ARG L4T_TAG=r36.2.0
FROM nvcr.io/nvidia/l4t-base:${L4T_TAG}
#
# Install any utils needed for execution
#
RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
#
# Install nvidia-cuda-dev for CUDA developer packages
# Use nvidia-cuda if need CUDA runtime only
#
RUN apt-get update && apt-get install -y --no-install-recommends \
nvidia-cuda \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
#
# Install nvidia-cudnn8-dev for CuDNN developer packages
# Use nvidia-cudnn8 if need CuDNN runtime only
#
RUN apt-get update && apt-get install -y --no-install-recommends \
nvidia-cudnn8 \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# #
# # Install nvidia-tensorrt-dev for TensorRT developer packages
# # Use nvidia-tensorrt if need TensorRT runtime only
# #
# RUN apt-get update && apt-get install -y --no-install-recommends \
# nvidia-tensorrt \
# && rm -rf /var/lib/apt/lists/* \
# && apt-get clean
#
# Install nvidia-vpi-dev for VPI developer packages
# Use nvidia-vpi if need VPI runtime only
#
RUN mkdir -p /lib/firmware/
RUN apt-get update && apt-get install -y --no-install-recommends \
nvidia-vpi \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
#
# Install Multimedia API samples & libs
#
RUN apt-get update && apt-get download nvidia-l4t-jetson-multimedia-api \
&& dpkg-deb -R ./nvidia-l4t-jetson-multimedia-api_*_arm64.deb ./mm-api \
&& cp -r ./mm-api/usr/src/jetson_multimedia_api /usr/src/jetson_multimedia_api \
&& ./mm-api/DEBIAN/postinst \
&& rm -rf ./nvidia-l4t-jetson-multimedia-api_*_arm64.deb ./mm-api
#Update libraries
RUN ldconfig
#
# Setup environment variables
#
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
but I am getting the following errors when trying to install nvidia-cuda package:
#6 [3/8] RUN apt-get update && apt-get install -y --no-install-recommends nvidia-cuda && rm -rf /var/lib/apt/lists/* && apt-get clean
#6 0.704 Get:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease [270 kB]
#6 0.955 Get:2 https://repo.download.nvidia.com/jetson/common r36.2 InRelease [2555 B]
#6 1.016 Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [128 kB]
#6 1.101 Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease [127 kB]
#6 1.185 Get:5 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [129 kB]
#6 2.467 Get:6 http://ports.ubuntu.com/ubuntu-ports jammy/restricted arm64 Packages [24.2 kB]
#6 2.583 Get:7 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 Packages [17.2 MB]
#6 5.479 Get:8 https://repo.download.nvidia.com/jetson/common r36.2/main arm64 Packages [24.3 kB]
#6 27.90 Get:9 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages [1758 kB]
#6 29.77 Get:10 http://ports.ubuntu.com/ubuntu-ports jammy/multiverse arm64 Packages [224 kB]
#6 29.96 Get:11 http://ports.ubuntu.com/ubuntu-ports jammy-updates/multiverse arm64 Packages [29.5 kB]
#6 30.00 Get:12 http://ports.ubuntu.com/ubuntu-ports jammy-updates/restricted arm64 Packages [2008 kB]
#6 31.71 Get:13 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 Packages [1340 kB]
#6 32.98 Get:14 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages [1944 kB]
#6 34.14 Get:15 http://ports.ubuntu.com/ubuntu-ports jammy-backports/universe arm64 Packages [30.3 kB]
#6 34.15 Get:16 http://ports.ubuntu.com/ubuntu-ports jammy-backports/main arm64 Packages [80.6 kB]
#6 34.15 Get:17 http://ports.ubuntu.com/ubuntu-ports jammy-security/universe arm64 Packages [1062 kB]
#6 34.39 Get:18 http://ports.ubuntu.com/ubuntu-ports jammy-security/main arm64 Packages [1689 kB]
#6 37.48 Get:19 http://ports.ubuntu.com/ubuntu-ports jammy-security/multiverse arm64 Packages [24.1 kB]
#6 37.51 Get:20 http://ports.ubuntu.com/ubuntu-ports jammy-security/restricted arm64 Packages [1946 kB]
#6 39.00 Fetched 30.1 MB in 39s (781 kB/s)
#6 39.00 Reading package lists...
#6 43.07 W: https://repo.download.nvidia.com/jetson/common/dists/r36.2/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
#6 43.33 Reading package lists...
#6 47.37 Building dependency tree...
#6 47.97 Reading state information...
#6 48.09 Some packages could not be installed. This may mean that you have
#6 48.09 requested an impossible situation or if you are using the unstable
#6 48.09 distribution that some required packages have not yet been created
#6 48.09 or been moved out of Incoming.
#6 48.09 The following information may help to resolve the situation:
#6 48.09
#6 48.09 The following packages have unmet dependencies:
#6 48.31 cuda-compat-12-2 : PreDepends: nvidia-l4t-core but it is not installable
#6 48.31 nvidia-l4t-cudadebuggingsupport : Depends: nvidia-l4t-cuda (> 36.0.0-0) but it is not installable
#6 48.31 Depends: nvidia-l4t-cuda (< 37.0.0-0) but it is not installable
#6 48.32 E: Unable to correct problems, you have held broken packages.
#6 ERROR: process "/bin/sh -c apt-get update && apt-get install -y --no-install-recommends nvidia-cuda && rm -rf /var/lib/apt/lists/* && apt-get clean" did not complete successfully: exit code: 100