名称¶
podman-image-scp - 安全地将镜像从一台主机复制到另一台主机
概要¶
podman image scp [选项] 名称[:标签]
描述¶
podman image scp 在网络上复制主机之间容器镜像。此命令可以将镜像复制到远程主机或从远程主机复制,也可以在两个远程主机之间复制。注意:::
用于指定镜像名称,具体取决于 Podman 是否正在保存或加载。也可以在不使用 sshd 的情况下,将镜像从同一台机器上的 rootful 存储传输到 rootless 存储。此功能在远程客户端不支持,包括 Mac 和 Windows(不包括 WSL2)机器。
podman image scp [全局选项]
podman image scp [选项] 名称[:标签] [主机名::]
podman image scp [选项] [主机名::]镜像名称
podman image scp [选项] [主机名::]镜像名称 [主机名::]
选项¶
--help, -h¶
打印使用说明
--quiet, -q¶
抑制输出
示例¶
将指定镜像复制到本地存储
$ podman image scp alpine
Loaded image: docker.io/library/alpine:latest
将指定镜像从本地存储复制到远程连接
$ podman image scp alpine Fedora::/home/charliedoern/Documents/alpine
Getting image source signatures
Copying blob 72e830a4dff5 done
Copying config 85f9dc67c7 done
Writing manifest to image destination
Storing signatures
Loaded image: docker.io/library/alpine:latest
将指定镜像从远程连接复制到远程连接
$ podman image scp Fedora::alpine RHEL::
Loaded image: docker.io/library/alpine:latest
通过 ssh 将指定镜像复制到本地存储
$ podman image scp [email protected]:22/run/user/1000/podman/podman.sock::alpine
WARN[0000] Unknown connection name given. Please use system connection add to specify the default remote socket location
Getting image source signatures
Copying blob 9450ef9feb15 [--------------------------------------] 0.0b / 0.0b
Copying config 1f97f0559c done
Writing manifest to image destination
Storing signatures
Loaded image: docker.io/library/alpine:latest
将指定镜像从 root 帐户复制到用户帐户本地存储
$ sudo podman image scp root@localhost::alpine username@localhost::
Copying blob e2eb06d8af82 done
Copying config 696d33ca15 done
Writing manifest to image destination
Storing signatures
Getting image source signatures
Copying blob 5eb901baf107 skipped: already exists
Copying config 696d33ca15 done
Writing manifest to image destination
Storing signatures
Loaded image: docker.io/library/alpine:latest
将指定镜像从 root 帐户复制到本地存储
$ sudo podman image scp root@localhost::alpine
Copying blob e2eb06d8af82 done
Copying config 696d33ca15 done
Writing manifest to image destination
Storing signatures
Getting image source signatures
Copying blob 5eb901baf107
Copying config 696d33ca15 done
Writing manifest to image destination
Storing signatures
Loaded image: docker.io/library/alpine:latest
参见¶
podman(1), podman-load(1), podman-save(1), podman-remote(1), podman-system-connection-add(1), containers.conf(5), containers-transports(5)
历史¶
2021 年 7 月,由 Charlie Doern 编写 cdoern@redhat.com