NAME¶ 名称
podman-mount - Mount a working container’s root filesystem
podman-mount - 挂载工作容器的根文件系统
SYNOPSIS¶ 概要
podman mount [options] [container …]
podman mount [选项] [容器 …]
podman container mount [options] [container …]
podman 容器挂载 [选项] [容器 …]
DESCRIPTION¶ 描述
Mounts the specified containers’ root file system in a location which can be
accessed from the host, and returns its location.
挂载指定容器的根文件系统到可以从主机访问的位置,并返回其位置。
Podman lists all of the currently mounted containers, including external containers, when the command is executed
without any arguments. External containers are containers in container/storage by tools other than Podman.
For example Buildah and CRI-O.
当执行命令时,Podman 列出所有当前挂载的容器,包括外部容器。外部容器是指由 Podman 以外的工具(例如 Buildah 和 CRI-O)在 container/storage 中的容器。
Rootless mode only supports mounting VFS driver, unless Podman is run within the user namespace
via the podman unshare
command. All other storage drivers fails to mount.
仅支持在 Rootless 模式下挂载 VFS 驱动程序,除非通过 podman unshare
命令在用户命名空间内运行 Podman。所有其他存储驱动程序均无法挂载。
RETURN VALUE¶ 返回值 ¶
The location of the mounted file system. On error an empty string and errno is
returned.
挂载文件系统的位置。发生错误时返回空字符串和错误代码。
OPTIONS¶ 选项
--all, -a¶
Mount all podman containers. (External containers are not mounted)
挂载所有的 podman 容器。(外部容器不被挂载)
--format=format¶
Print the mounted containers in specified format (json).
以指定格式(json)打印已挂载的容器。
--latest, -l¶
Instead of providing the container name or ID, use the last created container.
Note: the last started container can be from other users of Podman on the host machine.
(This option is not available with the remote Podman client, including Mac and Windows
(excluding WSL2) machines)
不要提供容器名称或 ID,而是使用最后创建的容器。注意:最后启动的容器可能来自主机上其他 Podman 用户。(此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)主机)
--no-trunc¶
Do not truncate the output (default false).
不要截断输出(默认为 false)。
EXAMPLE¶ 例子 ¶
In rootful mode, Mount specified container.
在 rootful 模式下,挂载指定的容器。
# podman mount c831414b10a3
/var/lib/containers/storage/overlay/f3ac502d97b5681989dff84dfedc8354239bcecbdc2692f9a639f4e080a02364/merged
In rootless mode, container mounting only works from inside the user namespace.
在无根模式下,容器挂载只能在用户命名空间内部工作。
$ podman unshare
# podman mount affectionate_mcnulty
/home/dwalsh/.local/share/containers/storage/overlay/4218326b9a80619aef005ff95067f76687ad975ce101c176598fb416f6186906/merged
List the currently mounted containers:
列出当前已挂载的容器:
podman mount
c831414b10a3 /var/lib/containers/storage/overlay/f3ac502d97b5681989dff84dfedc8354239bcecbdc2692f9a639f4e080a02364/merged
a7060253093b /var/lib/containers/storage/overlay/0ff7d7ca68bed1ace424f9df154d2dd7b5a125c19d887f17653cbcd5b6e30ba1/merged
Mount multiple containers:
挂载多个容器:
podman mount c831414b10a3 a7060253093b
/var/lib/containers/storage/overlay/f3ac502d97b5681989dff84dfedc8354239bcecbdc2692f9a639f4e080a02364/merged
/var/lib/containers/storage/overlay/0ff7d7ca68bed1ace424f9df154d2dd7b5a125c19d887f17653cbcd5b6e30ba1/merged
SEE ALSO¶ 参见 ¶
podman(1), podman-unmount(1), podman-unshare(1), mount(8)
podman(1),podman-unmount(1),podman-unshare(1),mount(8)