Docker image with Pytorch, Torchvision and Tensorrt

Hello Everyone,

I am in the process of building a docker image to run trt_pose skeleton model found on the forum. It makes use of Pytorch, Torchvision, Tensorrt and couple of other libraries. I am able to run the skeleton model locally on jetson Tx2, however the current requirement is to run the model on the docker container. When I am trying to build and run the image with all the dependencies installed, some or the other errors pop up.
I created ENV path inside the dockerfile and also copied couple of libraries in cuda/lib64 manually inside the image to install the torchvision smoothly. The image is built without any issues, but when I run the trt_pose, I get torch.cuda.is_available() as false. I also used couple of l4t images as base which had tensorrt,pytorch,torhvision pre-installed, but I am facing one or the other issues.When I try to run my docker image with Nvidia runtime, it throws error response from daemon: oci runtime create failed executable file not found in $path’’: unknown error. I think CUDA is not available during runtime, which might be one of the cause for the errors to pop up. How can I use the CUDA on the jetpack 4.4 during the building of image? CUDA is required in this case while building the docker image since torchvision looks for cuda related libraries and also need cuda during runtime. Can you please help me in creating a docker image which runs trt_pose successfully ? Please let me know if I am missing something. Thank you.