NAME 名称

podman-container-cleanup - Clean up the container’s network and mountpoints
podman-container-cleanup - 清理容器的网络和挂载点

SYNOPSIS 概要

podman container cleanup [options] container [container …]
podman 容器清理 [选项] 容器 [容器 …]

DESCRIPTION 描述

podman container cleanup cleans up exited containers by removing all mountpoints and network configurations from the host. The container name or ID can be used. The cleanup command does not remove the containers. Running containers are not cleaned up.
podman 容器清理通过从主机中删除所有挂载点和网络配置来清理已退出的容器。可以使用容器名称或 ID。清理命令不会删除容器。正在运行的容器不会被清理。

Sometimes container mount points and network stacks can remain if the podman command was killed or the container ran in daemon mode. This command is automatically executed when containers are run in daemon mode by the conmon process when the container exits.
有时,如果 podman 命令被终止或容器在守护程序模式下运行,容器挂载点和网络堆栈可能会保留下来。当容器退出时,此命令将由 conmon process 自动执行,当容器以守护程序模式运行时。

OPTIONS 选项

--all, -a

Clean up all containers. 清理所有容器。
The default is false.
默认值为 false。

IMPORTANT: This OPTION does not need a container name or ID as input argument.
重要提示:此选项不需要容器名称或 ID 作为输入参数。

--exec=session

Clean up an exec session for a single container. It can only be specified if a single container is being cleaned up (conflicts with --all as such). If --rm is not specified, temporary files for the exec session are cleaned up; if it is, the exec session is removed from the container.
为单个容器清理执行会话。仅当清理单个容器时才能指定它(与 --all 冲突)。如果未指定 --rm,则清理执行会话的临时文件;如果指定了 --rm,则从容器中删除执行会话。

IMPORTANT: Conflicts with --rmi as the container is not being cleaned up so the image cannot be removed.
重要提示:与 --rmi 冲突,因为容器未被清理,所以无法删除镜像。

--latest, -l

Instead of providing the container ID or name, use the last created container. The default is false. IMPORTANT: This OPTION is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines. This OPTION does not need a container name or ID as input argument.
使用最后创建的容器,而不是提供容器的 ID 或名称。默认值为 false。重要提示:此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)机器。此选项不需要容器名称或 ID 作为输入参数。

--rm

After cleanup, remove the container entirely.
清理后,完全删除容器。

The default is false.
默认值为 false。

--rmi

After cleanup, remove the image entirely.
清理后,完全删除镜像。

The default is false.
默认值为 false。

EXAMPLES 示例

Clean up the container “mywebserver”.
清理容器“mywebserver”。

$ podman container cleanup mywebserver

Clean up the containers with the names “mywebserver”, “myflaskserver”, “860a4b23”.
使用名称为“mywebserver”、“myflaskserver”、“860a4b23”的容器进行清理。

$ podman container cleanup mywebserver myflaskserver 860a4b23

SEE ALSO 参见 ¶

podman(1), podman-container(1), conmon(8)
podman(1),podman-container(1),conmon(8)

HISTORY 历史 ¶

Jun 2018, Originally compiled by Dan Walsh dwalsh@redhat.com
2018 年 6 月,最初由 Dan Walsh dwalsh@redhat.com 编译。