Have you checked the step for Nvidia support in Docker?

  
      

      TensorFlow
  

  
    

Docker  |  TensorFlow 2



  

  
    
    
  

  



  
      

      github.com
  

  
    

GitHub - NVIDIA/nvidia-docker: Build and run Docker containers leveraging NVIDIA... - Getting Started 9


  Build and run Docker containers leveraging NVIDIA GPUs - GitHub - NVIDIA/nvidia-docker: Build and run Docker containers leveraging NVIDIA GPUs