名称¶
podman-unmount - 卸载正在运行的容器的根文件系统
简介¶
podman unmount [选项] 容器 […]
podman umount [选项] 容器 […]
podman container unmount [选项] 容器 […]
podman container umount [选项] 容器 […]
描述¶
卸载指定容器的根文件系统,如果没有其他进程正在使用它。
每次挂载容器时,容器存储都会增加一个挂载计数器。当容器被卸载时,挂载计数器会递减,并且只有当挂载计数器达到零时(表示没有其他进程正在使用该挂载)才会实际卸载容器的根文件系统。可以使用 --force 标志强制卸载。
注意:Podman 可用于卸载 Podman 容器以及外部容器。外部容器是由 Buildah 和 CRI-O 等其他工具在 container/storage 中创建的容器。
选项¶
--all, -a¶
卸载所有当前已挂载的容器。
--force, -f¶
强制卸载指定容器的根文件系统,即使其他进程已挂载它。
注意:如果其他进程正在使用的挂载点在它们不知情的情况下被移除,它们可能会失败。
--latest, -l¶
不提供名称或 ID,而是使用最新创建的容器。注意:最新创建的容器可能来自主机上 Podman 的其他用户。(此选项不适用于远程 Podman 客户端,包括 Mac 和 Windows(WSL2 除外)机器)
示例¶
卸载具有给定 ID 的容器
podman container unmount containerID
卸载具有给定 ID 的多个容器
podman unmount containerID1 containerID2 containerID3
卸载所有容器
podman unmount --all
强制卸载具有给定 ID 的容器
podman umount --force containerID