Mounting /tmp/nvcamera_socket in docker wrapper fails

I’m trying to run a docker image using this wrapper:

sudo docker run -it -e DISPLAY=$DISPLAY 
-v /tmp/.X11-unix:/tmp/.X11-unix 
-v /usr/lib/aarch64-linux-gnu/tegra:/usr/lib/aarch64-linux-gnu/tegra  
-v /tmp/nvcamera_socket:/tmp/nvcamera_socket 
-v /devel/MARVEL-Datasets:/devel/MARVEL-Datasets 
-v /devel/marvel-sub-dataset:/devel/marvel-sub-dataset 
-v /devel/BACKUP:/devel/BACKUP 
-v /devel/frb-msubs:/devel/frb-msubs 
--device /dev/video0 
--device /dev/nvhost-vic 
--ipc=host --rm -p 8888:8888 $1 <image> bash

But it returns this error:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\"/tmp/nvcamera_socket\\" to rootfs \\"/devel/MyDocker/overlay2/0435ee90e4a69b88dd84665d845528233f19b7f4cabf6c112cc4be06bdd16985/merged\\" at \\"/devel/MyDocker/overlay2/0435ee90e4a69b88dd84665d845528233f19b7f4cabf6c112cc4be06bdd16985/merged/tmp/nvcamera_socket\\" caused \\"not a directory\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

With syslog output:

May  9 10:11:57 msubsai-desktop dockerd[7692]: time="2019-05-09T10:11:57.209213660+01:00" level=error msg="f17cfb506ea2a8201fa0afd25ea25acbdb$

The wrapper works correctly when I remove the /tmp/nvcamera_socket:/tmp/nvcaera_socket argument or change it to /tmp/nvcamera_socket:/devel/nvcamera_socket (/devel being a mount point for external hard drive that I have docker running on). The permissions for /tmp are:

drwxrwxrwt  16 root     root      4096 May 14 14:23 tmp

and the permissions for /tmp inside an image I’m trying to run:

drwxrwxrwt   1 root root 4096 Jan  4 22:12 tmp

Any insight you can provide on this would be much appreciated.
Thanks in advance,

Which BSP did you working on.

Hi Shane,

I’m using L4T R32 v1.0 (Jetpack 4.2) on the TX2.


Hi david

We just verified on 32.1 + TX2 and did not see any error with the standard ubuntu container.

sudo docker run -it -e DISPLAY=$DISPLAY -v /tmp/nvcamera_socket:/tmp/nvcamera_socket --ipc=host --rm -p 8888:8888 ubuntu bash

Hi Shaun,

Thanks - I tested it with this wrapper and it worked fine , so I inspected the image I was using closer and it seems the author had made /tmp/nvcamera_socket a file rather than a directory. I have forked the image with my own version where it is a directory and it works fine.

Many Thanks,