×

Pod 中的每个容器都有一个容器镜像。创建镜像并将其推送到注册表后,您就可以在 Pod 中引用它。

镜像拉取策略概述

当 OpenShift Dedicated 创建容器时,它使用容器imagePullPolicy来确定是否应该在启动容器之前拉取镜像。imagePullPolicy共有三个可能的值

表 1. imagePullPolicy
描述

始终 (Always)

始终拉取镜像。

如果不存在 (IfNotPresent)

只有在节点上不存在镜像时才拉取镜像。

从不 (Never)

从不拉取镜像。

如果未指定容器imagePullPolicy参数,OpenShift Dedicated 将根据镜像标签设置它。

  1. 如果标签是latest,OpenShift Dedicated 将imagePullPolicy默认为Always

  2. 否则,OpenShift Dedicated 将imagePullPolicy默认为IfNotPresent