Docker rm

From NovaOrdis Knowledge Base
Revision as of 01:05, 31 January 2018 by Ovidiu (talk | contribs) (→‎Remove Exited Containers)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

docker rm <options> <container-id>

A running container cannot be removed unless -f is used.

Once deleted, a container discards its writable layer so the state maintained there from previous runs is lost. The base image is not modified.

Options

-f, --force

Force the removal of a running container (uses SIGKILL).

Remove Exited Containers

docker rm $(docker ps --filter "status=exited" -q --no-trunc)

Also see docker ps.