osrf / rocker

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

How to start previously created container? #145

Closed edgarcamilocamacho closed 2 years ago

edgarcamilocamacho commented 3 years ago

After running something like:

rocker --nvidia --x11 --nocleanup --name TEST1 ubuntu:18.04

The container remains created (because of the --nocleanup flag), but I don't know how to reuse that container instead of creating one new.

If I just run:

docker start -ai TEST1

I get an error like:

Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:495: container init caused ...
tfoote commented 3 years ago

Did you truncate the error message with "..." ? That's removing the most important parts.

I can reproduce this:

$ docker start -ai TEST1 
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/tmp/.dockeri02f00sm.xauth" to rootfs at "/tmp/.dockeri02f00sm.xauth" caused: mount through procfd: 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

And what I notice is that the original docker run command created by rocker provided a lot of runtime arguments for the container

docker run -it --name TEST1   --gpus all  -e DISPLAY -e TERM   -e QT_X11_NO_MITSHM=1   -e XAUTHORITY=/tmp/.dockeri02f00sm.xauth -v /tmp/.dockeri02f00sm.xauth:/tmp/.dockeri02f00sm.xauth   -v /tmp/.X11-unix:/tmp/.X11-unix   -v /etc/localtime:/etc/localtime:ro  4fa88c12f722 

It appears that docker start is attempting to remount the volumes such as the xauth however failing to do so. I don't know more about this. At this point it's not really about rocker anymore, just docker run then docker start needing to reproduce that environment.