When I tried your solution, I got the following when I tried to build the revised image:
sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the ‘nosuid’ option set or an NFS file system without root privileges?
The command ‘/bin/bash -c sudo apt update && sudo apt install -y binutils xxd’ returned a non-zero code: 1
And when I remove the sudo, I get:
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
Thanks for the reply. I am on 20.04. I am using Docker version 20.10.6, and yes, I am using the official image that you referenced. I did find an answer though below (the long of the short of it is that my docker stuff is all on a disk that was mounted with nosuid, removed that and the container built as advertised.)
2 other things were required before it all worked:
But a big thanks on this. Let me just say that this is an area where nvidia (who are generally pretty good about these things) puts too much on developer’s shoulders just to get to the starting gate.