This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.13.2.4. 引用镜像流中的镜像
可以使用以下引用类型在镜像流中引用镜像:
ImageStreamTag
用于引用或检索给定镜像流和标签的镜像。它的名称使用以下惯例:<image_stream_name>:<tag>
<image_stream_name>:<tag>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImageStreamImage
用于引用或检索给定镜像流和镜像名称的镜像。它的名称使用以下惯例:<image_stream_name>@<id>
<image_stream_name>@<id>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow <id>
是针对特定镜像的不可变标识符,也称摘要。DockerImage
用于引用或检索给定外部 registry 的镜像。它使用标准 Docker 拉取规格 作为名称,例如:openshift/ruby-20-centos7:2.0
openshift/ruby-20-centos7:2.0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意如果未指定标签,则会假定使用 latest标签。
此外,您还可引用第三方 registry:
registry.access.redhat.com/rhel7:latest
registry.access.redhat.com/rhel7:latest
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 或者带有摘要的镜像:
centos/ruby-22-centos7@sha256:3a335d7d8a452970c5b4054ad7118ff134b3a6b50a2bb6d0c07c746e8986b28e
centos/ruby-22-centos7@sha256:3a335d7d8a452970c5b4054ad7118ff134b3a6b50a2bb6d0c07c746e8986b28e
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
当查看镜像流定义示例时,如 CentOS 镜像流示例,您可能会注意到它们包含 ImageStreamTag
的定义以及 DockerImage
的引用,但不与 ImageStreamImage
相关。
这是因为当您将镜像导入或标记到镜像流时,OpenShift Container Platform 中会自动创建 ImageStreamImage
对象。您不必在用于创建镜像流的任何镜像流定义中显式定义 ImageStreamImage
对象。
您可以使用镜像流名称和 ID 检索 ImageStreamImage
定义,来查看镜像的对象定义:
oc export isimage <image_stream_name>@<id>
$ oc export isimage <image_stream_name>@<id>
您可以运行以下命令来找到给定镜像流的有效 <id>
值:
oc describe is <image_stream_name>
$ oc describe is <image_stream_name>
例如,在 ruby 镜像流中,要求 ImageStreamImage
的名称和 ID 为 ruby@3a335d7 :
通过 ImageStreamImage
检索镜像对象的定义