https://docs.docker.com/engine/reference/commandline/ps/ says
status One of created, restarting, running, removing, paused, exited, or dead
What does "dead" status mean for a container?
Does "dead" mean that the container has been removed by
docker rm
? So will a dead container not be shown up bydocker ps --all
?Does "dead" mean that "A container that the daemon tried and failed to stop (usually due to a busy device or resource used by the container)"? I haven't found where that comes from. I am not sure that is correct, because can "failed to stop" mean the container is running?
Also does "exited" mean "A container that ran and completed"? If a container exits before completion due to error, what is its status?
Just going by the documentation I could find:
From Docker maintainer Sebastiaan van Stijn, https://github.com/docker/cli/issues/502#issuecomment-330361748 That is a pretty authoritative source on the matter, so it does look like the Stackoverflow answer you linked to was correct.
docker rm was performed, but only partially succeeded, so it's still there, in that
dead
state.And yes, they would show up in ps --all:
Its status is "Exited" with the error code it returned, e.g. "Exited (1) 10 seconds ago". https://success.docker.com/article/what-is-the-difference-between-dead-and-exited-containers
Yes, the status includes the exit status code of the main process.