liveBook · Manning

Exited state

As explained in Learn Docker in a Month of Lunches, Second Edition

An exited state is the condition of a container whose main application process has ended and is no longer running.

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

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Defines exit conditions, resource use, persistence, inspection, reuse, and cleanup without explaining container internals.
Examples
Uses Hello World, an interactive shell, and docker container ls --all output to demonstrate exited containers.
What it assumes
Assumes familiarity with running containers and distinguishes command containers from interactive and background services.
What you can do after
Operate Docker containers by listing, restarting, inspecting, copying, and removing exited instances.
How it connects
Connects container lifecycle with application processes, terminal sessions, logs, filesystems, and Docker container listing.

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.