如何在openshift中将图像从一个项目拖到另一个项目?

我创build了一个项目testing1在这个项目中我发布了docker镜像。

现在,我想创build类似的另一个项目testing2与我在testing1推送的相同的图像。 我不想再发布它。

login到您的openshift命令行并运行命令:

 oc policy add-role-to-user \ system:image-puller system:serviceaccount:testing1:default \ --namespace=testing2 

要么

 oc policy add-role-to-user \ system:image-puller system:serviceaccount:testing1:default \ -n testing2 

您的项目testing2将能够在您的openshift中从项目testing1中访问图像。

有关更多信息,请参阅openshift文档