自行开发的app, 如果没有从source code build 到openshift, 那么我们可以用Dockerfile自行打包images, 并存放到openshift 具体的project中去部署使用。
例如:
abc.png
下面记录下具体步骤:
# oc get svc -n default
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
docker-registry ClusterIP 172.30.235.48 5000/TCP 35d
上面可以查询到具体的docker registry name以及ip.
用docker login连接到该pod:
# docker login docker-registry.default.svc:5000
Username: user.id
Password: [登陆openshift的串码]
Login Succeeded
接下来就可以push image到具体的project里了:
To push an image to this image stream:
$ sudo docker tag myimage registry/myproject/myimage:tag
$ sudo docker push registry/myproject/myimage:tag
下面是个真实范例:
# docker tag cas-svc:1.0.0 docker-registry.default.svc:5000/demo-project/cas-svc:1.0.0
# docker push docker-registry.default.svc:5000/demo-project/cas-svc:1.0.0
The push refers to a repository [docker-registry.default.svc:5000/demo-project/cas-svc]
638735aba39b: Pushed
4ffb2c49a619: Pushed
e33af80de3fe: Pushed
79fe6d0e931d: Pushed
685fdd7e6770: Pushed
c9b26f41504c: Pushed
cd7100a72410: Pushed
1.0.0: digest: sha256:67c018604ad33d420e79c20a3f40e77b0fabe610f2cf2ead86217c0ff7655a27 size: 1782
网友评论