Status: Exited (127) container after using rocker

reproduce the error (ubuntu)

rocker --x11 --nocleanup --privileged osrf/ros:noetic-desktop-full
to start the image, and then inside the container i type the exit command.
docker ps -a
i get the container with status Exit(0).
the when i want to start the container i use
docker start id
getting this 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/.dockerhl7oumo6.xauth” to rootfs at “/tmp/.dockerhl7oumo6.xauth”: mount /tmp/.dockerhl7oumo6.xauth:/tmp/.dockerhl7oumo6.xauth (via /proc/self/fd/8), 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: e669de809abb

and with
docker ps -a
i have that the container has Status: Exited (127) .
i tried many things like deleting rocker and docker, even following the error response but nothing works.
if i start the container using only docker run than everything works fine. this problem arise only when using rocker.
when i use docker logs, the container automatically exit without giving me messages.

I don’t know what rocker does exactly and what docker command it builds . The output of

docker container inspect CONTAINERNAME

would help, but as the error message says the container wants to mount a non-existent folderor file. That file isprobably created by rocker and when you use only Docker commands it can’t handle it so it is not created and the container fails. If rocker can start an existing container that was created by it, you should use only rocker commands. .

1 Like

even when i use rocker to start the container nothing happens, this is why i use docker. im trying now to install docker from source as someone suggested me:Status: Exited (127) container after using rocker · Issue #216 · osrf/rocker · GitHub

They suggested building Rocker from source, not Docker. I hope you just accidentally wrote “docker” here.
If I understand it correctly, Rocker always removed some files when the container stopped and that was fixed. I also don’t know what the --nocleanup mode is, so you might need some extra parameters too.

ok i figure it out.after alot of trials.
docker exec -it bash
gives me no problem