我有一个图像流,其定义如下,具有 openshift 起源。当我在 openshift 中创建、导入或更新图像流对象时,它将自动拾取 docker 存储库中定义的任何标签。当我通过 docker 推送图像(即 docker push <private-repo-host-and-port>/myimage
)时,图像流不会使用 docker 中的新图像进行更新。我必须手动更新图像流或重新导入它或重新创建它。此外,我还设置了一个 openshift 构建,它输出到图像流,当构建成功完成时,它将构建的输出图像推送到私有(private) docker 存储库,但图像流不会接收到此信息,除非我重新-导入或更新或重新创建图像流 - 它不会自动执行。我设置了部署配置来获取图像流的更新,并且当图像流更新时它确实会触发新的部署,但我必须手动更新图像流。
当支持的私有(private) Docker 存储库更新时,如何让镜像流自动更新?
apiVersion: v1
kind: ImageStream
metadata:
name: isname
namespace: mynamespace
labels:
deployment-id: master
name: isname
namespace: mynamespace
spec:
dockerImageRepository: '<private-repo-host-and-port>/myimage'
tags:
- name: latest
from:
kind: DockerImage
name: '<private-repo-host-and-port>/myimage:latest'
importPolicy:
scheduled: true
让我知道是否需要其他配置
最佳答案
阅读:
6: How can I tell the system to periodically import my tag? When we are working with an external registry, we would like to be able to periodically re-import the image to get latest security updates, etc. To do so we will use a --scheduled flag for the oc tag command like so:
oc tag docker.io/python:3.6.0 python:3.6 --scheduled
This will inform the system that this particular Image Stream Tag should be periodically checked for updates. Currently, this period is a cluster-wide setting, and by default, it is set to 15 minutes.
Only an Image Stream Tag pointing to an external docker registry can be periodically checked for updates.
To remove the periodical check, re-run above command but omit the --scheduled flag. This will reset its behavior to default
关于image - openshift imagestream 不跟踪私有(private) docker 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45355021/