将本地 docker 图像推送到在线 openshift
Pushing local docker image to openshift online
我的机器 docker 上本地有一个 spring 启动应用程序 运行。
图片名称是springio/spring-rest-hello-world
,标签是latest
。我想把这个推到 openshift online 上获取 运行.
我认为最简单的方法是将图像向上推(如果我错了请纠正我)。
这是我的尝试。
oc login https://console-openshift-console.apps.us-east-1.starter.openshift-online.com:6443
oc project playpen
docker login -u myUser -p myToken default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com
docker tag springio/spring-rest-hello-world default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com:5000/springio/spring-rest-hello-world
docker push default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com:5000/springio/spring-rest-hello-world
错误是...
Get https://default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com:5000/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers
我是这方面的新手,所以我很确定我有问题。如果有人可以帮助我完成所需的步骤,我将不胜感激。
谢谢
感谢提供的评论。标记图像时无需包含 docker 端口。
我还需要使用标签中包含的 ocp 项目名称来标记图像。
docker tag springio/spring-rest-hello-world default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com/playpen/spring-rest-hello-world:latest
我的机器 docker 上本地有一个 spring 启动应用程序 运行。
图片名称是springio/spring-rest-hello-world
,标签是latest
。我想把这个推到 openshift online 上获取 运行.
我认为最简单的方法是将图像向上推(如果我错了请纠正我)。
这是我的尝试。
oc login https://console-openshift-console.apps.us-east-1.starter.openshift-online.com:6443
oc project playpen
docker login -u myUser -p myToken default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com
docker tag springio/spring-rest-hello-world default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com:5000/springio/spring-rest-hello-world
docker push default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com:5000/springio/spring-rest-hello-world
错误是...
Get https://default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com:5000/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers
我是这方面的新手,所以我很确定我有问题。如果有人可以帮助我完成所需的步骤,我将不胜感激。
谢谢
感谢提供的评论。标记图像时无需包含 docker 端口。
我还需要使用标签中包含的 ocp 项目名称来标记图像。
docker tag springio/spring-rest-hello-world default-route-openshift-image-registry.apps.us-east-1.starter.openshift-online.com/playpen/spring-rest-hello-world:latest