NAME

Podman-推送-将图像、清单列表或图像索引从本地存储推送到其他地方

SYNOPSIS

podman push [options] image [destination]

podman image push [options] image [destination]

DESCRIPTION

将图像、清单列表或图像索引从本地存储推送到指定目标。

图像存储

从存储在本地图像存储器中的图像推送图像。

DESTINATION

Destination是容器镜像推送到的位置。它支持所有来自 containers-transports(5) 。如果未指定传输,则 docker (即,容器注册)传输被使用。对于远程客户端,包括Mac和Windows(不包括WSL2)计算机, docker 是唯一受支持的传输方式。

# Push to a container registry
$ podman push quay.io/podman/stable

# Push to a container registry via the docker transport
$ podman push docker://quay.io/podman/stable

# Push to a container registry with another tag
$ podman push myimage quay.io/username/myimage

# Push to a local directory
$ podman push myimage dir:/tmp/myimage

# Push to a tarball in the docker-archive format
$ podman push myimage docker-archive:/tmp/myimage

# Push to a local docker daemon
$ sudo podman push myimage docker-daemon:docker.io/library/myimage:33

# Push to a tarball in the OCI format
$ podman push myimage oci-archive:/tmp/myimage

OPTIONS

--authfile = path

身份验证文件的路径。缺省值为 ${XDG_RUNTIME_DIR}/containers/auth.json 在Linux上,以及 $HOME/.config/containers/auth.json 在Windows/MacOS上。该文件由创建 podman login 。如果在那里找不到授权状态, $HOME/.docker/config.json 被选中,它是使用 docker login

注意:还可以通过设置 REGISTRY_AUTH_FILE 环境变量这可以通过以下方式完成 export REGISTRY_AUTH_FILE=path

--cert-dir = path

在以下位置使用证书 path (\ *.crt, * .cert,\ *.key) to connect to the registry. (Default: /etc/containers/certs.d) For details, see * containers-certs.d(5) *。(此选项不适用于远程Podman客户端,包括Mac和Windows(不包括WSL2)计算机)

--compress

当使用‘dir’传输推送到目录时,压缩tarball图像层。(默认为与源文件相同的压缩类型,压缩或未压缩)

注意:此标志只能在使用 dir 运输

--compression-format = gzip | zstd | zstd:chunked

指定要使用的压缩格式。支持的值包括: gzipzstdzstd:chunked 。缺省值为 gzip 除非在tainers.conf文件中被覆盖。

--compression-level = level

指定要使用的压缩级别。该值特定于使用的压缩算法,例如,对于zstd,接受的值介于1-20(含)范围内,缺省值为3;而对于gZip,其值为1-9(含),缺省值为5。

--creds = [[用户名[:密码]]]

这个 [username[:password] ]如有需要,可用于向登记处进行认证。如果未提供其中一个或两个值,则会出现命令行提示符并可以输入值。输入密码时没有回显。

请注意,指定的凭据仅用于针对目标注册表进行身份验证。它们不用于镜像或在重写注册表时(请参见 containers-registries.conf(5) );要针对那些考虑使用 containers-auth.json(5) 文件。

--digestfile = 摘要文件

复制图像后,将生成图像的摘要写入文件。

--disable-content-trust

这是特定于Docker的选项,用于禁用对容器注册表的镜像验证,Podman不支持。此选项是NOOP,仅用于脚本兼容性。

--encrypt-layer = layer(s)

层(S)加密:0-索引层索引,支持负索引(如0为第一层,-1为最后一层)。如果未定义,则在指定了加密密钥标志的情况下加密所有层。

--encryption-key = key

这个 [protocol:keyfile] 指定加密协议,可以是JWE(RFC7516)、PGP(RFC4880)和PKCS7(RFC2315)以及图像加密所需的密钥材料。例如,jwe:/Path/to/key.pem或pgp:admin@example.com或pkcs7:/Path/to/x509-file。

--force-compression

如果设置,则推送使用指定的压缩算法,即使目标已包含不同压缩的变量。默认为 true 如果 --compression-format 在命令行上显式指定, false 否则的话。

--format-f = 格式化

推送镜像时使用的清单类型(OCI、v2s2或v2s1)。

--quiet-q

写入输出图像时,禁止进度输出

--remove-signatures

丢弃图像中任何预先存在的签名。

--retry = attempts

失败时在注册表和本地存储之间重试拉取或推送映像的次数。缺省值为 3

--retry-delay = duration

如果失败,在注册表和本地存储之间拉取或推送图像时,重试尝试之间的延迟持续时间。默认情况下,开始时间为两秒,然后以指数方式后退。设置此值时使用延迟,并且不会发生指数回退。

--sign-by = key

在目标端使用指定的密钥添加一个简单签名。(此选项不适用于远程Podman客户端,包括Mac和Windows(不包括WSL2)计算机)

--sign-by-sigstore = param-file

根据容器的sigstore签名参数文件中指定的其他选项添加sigstore签名 param-file 。有关文件格式的详细信息,请参阅tainers-sigstore-sign-pars.yaml(5)。

--sign-by-sigstore-private-key = path

使用指定路径上的私钥在目标位置添加Sigstore签名。(此选项不适用于远程Podman客户端,包括Mac和Windows(不包括WSL2)计算机)

--sign-passphrase-file = path

如果对图像进行签名(使用 --sign-by--sign-by-sigstore-private-key ),则从指定路径中读取要使用的密码短语。

--tls-verify

联系注册处时要求HTTPS并验证证书(默认: true )。如果显式设置为 true ,使用TLS验证。如果设置为 false ,不使用TLS验证。如果未指定,则使用TLS验证,除非目标注册表在 containers-registries.conf(5)

EXAMPLE

将指定的镜像推送到本地目录:

# podman push imageID dir:/path/to/image

将指定的镜像以OCI格式推送到本地目录:

# podman push imageID oci-archive:/path/to/layout:image:tag

将指定的镜像推送到容器注册表:

# podman push imageID docker://registry.example.com/repository:tag

将指定镜像推送到容器注册表,并将摘要保存在指定文件中:

# podman push --digestfile=/tmp/mydigest imageID docker://registry.example.com/repository:tag

将指定镜像推送到本地Docker守护程序容器存储中:

# podman push imageID docker-daemon:image:tag

使用来自备用身份验证文件路径的凭据推送具有不同映像名称的指定映像:

# podman push --authfile temp-auths/myauths.json alpine docker://docker.io/umohnani/alpine
Getting image source signatures
Copying blob sha256:5bef08742407efd622d243692b79ba0055383bbce12900324f75e56f589aedb0
 4.03 MB / 4.03 MB [========================================================] 1s
Copying config sha256:ad4686094d8f0186ec8249fc4917b71faa2c1030d7b5a025c29f26e19d95c156
 1.41 KB / 1.41 KB [========================================================] 1s
Writing manifest to image destination
Storing signatures

将指定的镜像作为OCI镜像推送到本地目录:

# podman push --format oci registry.access.redhat.com/rhel7 dir:rhel7-dir
Getting image source signatures
Copying blob sha256:9cadd93b16ff2a0c51ac967ea2abfadfac50cfa3af8b5bf983d89b8f8647f3e4
 71.41 MB / 71.41 MB [======================================================] 9s
Copying blob sha256:4aa565ad8b7a87248163ce7dba1dd3894821aac97e846b932ff6b8ef9a8a508a
 1.21 KB / 1.21 KB [========================================================] 0s
Copying config sha256:f1b09a81455c351eaa484b61aacd048ab613c08e4c5d1da80c4c46301b03cf3b
 3.01 KB / 3.01 KB [========================================================] 0s
Writing manifest to image destination
Storing signatures

另请参阅

[podman(1)] , [podman-pull(1)] , [podman-login(1)] , [containers-certs.d(5)] , [containers-registries.conf(5)] , [containers-transports(5)]