An exited state means a container’s main application process has ended. The container is no longer running, uses no CPU or memory, and remains available for inspection or reuse. section 2.4
Use the exited state to understand what happens after a container stops:
- List exited containers with docker container ls --all; docker container ls shows only running containers. section 2.4
- Start an exited container again, inspect its logs, or copy files to and from its retained filesystem. section 2.4
- Remember that exited containers still consume disk space until explicitly removed. section 2.4
A command container exits
A Hello World container exits automatically when its script completes. An interactive container exits when its terminal session ends. section 2.4
