Yocto base image - install CUDA, cuDNN, TensorRT


I have a Yocto base image and I am trying to install CUDA, cuDNN and TensorRT on a Jetson Xavier in a container during the build phase without enabling them in the Yocto base image (because the libraries are too big and I want to keep my base image relatively small). Is there any way to do it, what would the download links be in the Dockerfile, for CUDA, its pretty straightforward:

RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa/cuda-ubuntu2004.pin &&
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 &&
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa/7fa2af80.pub &&
add-apt-repository “deb Index of /compute/cuda/repos/ubuntu2004/sbsa /” &&
apt-get update &&
apt-get -y install cuda
but I am not sure for cuDNN and TensorRT.

Can someone help me on this?