1podman-container-cleanup(1) General Commands Manualpodman-container-cleanup(1)
2
3
4

NAME

6       podman-container-cleanup  - Clean up the container's network and mount‐
7       points
8
9

SYNOPSIS

11       podman container cleanup [options] container [container ...]
12
13

DESCRIPTION

15       podman container cleanup cleans up exited containers  by  removing  all
16       mountpoints and network configuration from the host. The container name
17       or ID can be used. The cleanup command does not remove the  containers.
18       Running containers will not be cleaned up.
19       Sometimes  container  mount points and network stacks can remain if the
20       podman command was killed or the container ran  in  daemon  mode.  This
21       command  is  automatically  executed  when containers are run in daemon
22       mode by the conmon process when the container exits.
23
24

OPTIONS

26   --all, -a
27       Clean up all containers.
28       The default is false.
29       IMPORTANT: This OPTION does not need a container name or  ID  as  input
30       argument.
31
32
33   --exec=session
34       Clean up an exec session for a single container.  Can only be specified
35       if a single container is being cleaned  up  (conflicts  with  --all  as
36       such).  If  --rm is not specified, temporary files for the exec session
37       will be cleaned up; if it is, the exec session will be removed from the
38       container.
39       *IMPORTANT:  Conflicts with --rmi as the container is not being cleaned
40       up so the image cannot be removed.*
41
42
43   --latest, -l
44       Instead of providing the container ID or name,  use  the  last  created
45       container. If other methods than Podman are used to run containers such
46       as CRI-O, the last started container could  be  from  either  of  those
47       methods.
48       The default is false.
49       IMPORTANT:  This OPTION is not available with the remote Podman client,
50       including Mac and Windows (excluding WSL2) machines. This  OPTION  does
51       not need a container name or ID as input argument.
52
53
54   --rm
55       After cleanup, remove the container entirely.
56       The default is false.
57
58
59   --rmi
60       After cleanup, remove the image entirely.
61       The default is false.
62
63

EXAMPLES

65       Clean up the container "mywebserver".
66
67
68              $ podman container cleanup mywebserver
69
70
71
72       Clean  up the containers with the names "mywebserver", "myflaskserver",
73       "860a4b23".
74
75
76              $ podman container cleanup mywebserver myflaskserver 860a4b23
77
78
79

SEE ALSO

81       podman(1), podman-container(1), conmon(8)
82
83

HISTORY

85       Jun  2018,  Originally  compiled   by   Dan   Walsh   dwalsh@redhat.com
86       ⟨mailto:dwalsh@redhat.com⟩
87
88
89
90                                                   podman-container-cleanup(1)
Impressum