gpt4 book ai didi

来自本地 Docker 镜像的 Openshift 新应用

转载 作者:行者123 更新时间:2023-12-03 01:48:21 24 4
gpt4 key购买 nike


我正在尝试在 Openshift Origin Pod 上部署一个在我的 Docker 存储库中可用的镜像:

$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat9demo latest 535da1774da0 9 weeks ago 350.2 MB

运行时:

$ oc new-app tomcat9demo --name tomcatdemo

显然它似乎从 Docker 存储库中找到了镜像:

--> Found Docker image 535da17 (9 weeks old) from  for "tomcat9demo:latest"

* This image will be deployed in deployment config "tomcat9demo"
* Port 8080/tcp will be load balanced by service "tomcat9demo"
* Other containers can access this service through the hostname "tomcat9demo"
* WARNING: Image "tomcat9demo:latest" runs as the 'root' user which may not be permitted by your cluster administrator

--> Creating resources with label app=tomcat9demo ...
deploymentconfig "tomcat9demo" created
service "tomcat9demo" created
--> Success

但是状态显示错误。图像拉取似乎有错误:

$ oc get pods
NAME READY STATUS RESTARTS AGE
tomcat9demo-1-zrj98 0/1 ErrImagePull 0 16s
$ oc status
Error from server: the server could not find the requested resource

我还需要其他东西来从本地 Docker 存储库获取镜像吗?

最佳答案

您需要指定选项 --docker-image 使其指向您的本地镜像存储库。示例:

oc new-app tomcat9demo --docker-image tomcat9demo

关于来自本地 Docker 镜像的 Openshift 新应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43235543/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com