osrf / rocker

A tool to run docker containers with overlays and convenient options for things like GUIs etc.
Apache License 2.0
585 stars 75 forks source link

Cannot run a persistent container with x11 #187

Closed tonynajjar closed 2 years ago

tonynajjar commented 2 years ago

Steps to repoduce:

rocker --nocleanup --x11 --name test osrf/ros:rolling-desktop 
exit
docker start test

The error:

Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/tmp/.dockerj054ncrt.xauth" to rootfs at "/tmp/.dockerj054ncrt.xauth": mount /tmp/.dockerj054ncrt.xauth:/tmp/.dockerj054ncrt.xauth (via /proc/self/fd/7), flags: 0x5000: 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
Error: failed to start containers: test
tonynajjar commented 2 years ago

I think this is still an issue when the system is rebooted, everything is tmp is deleted :/

tfoote commented 2 years ago

Yeah, that definitely happens. I don't want to be generating a lot of persistent files in the default case. But maybe we can push the temp files into an alternative location. I was originally thinking of adding an argument but the python implementation already has an environment variable (apparently 3 actually) for this case that you could use.

https://docs.python.org/3/library/tempfile.html#tempfile.mkstemp

The default directory is chosen from a platform-dependent list, but the user of the application can control the directory location by setting the TMPDIR, TEMP or TMP environment variables.