openshift 创建imagestream 不成功 (解决)

今天实践了创建imagestream 不成功的case:

1: 先看一下image: 

docker images  发现有个image 是nginx, 所以就build 一下,报错:

[root@test3 ~]# oc new-build --image-stream=nginx --binary=true --name=shp
warning: Cannot find git. Ensure that it is installed and in your path. Git is required to work with git repositories.
error: no match for "nginx"

后来发现这个imagestream 和image 有区别:

2: 先看一下imagestream:

[root@test3 ~]# oc get is
No resources found.

我就奇怪了,登入到网页上,发现这个is (imagestream 是根据不同的project 而显示不同的)
[root@test3 ~]# oc project shp
Now using project "shp" on server "https://localhost:8443".
[root@test3 ~]# oc get is
NAME              DOCKER REPO   TAGS      UPDATED
hello-openshift                 latest    9 weeks ago

3:可以看到,切换到对应的project 下面,就可以看到imagestram 了。OK, 下面开始创建:

[root@test3 ~]# oc new-build --image-stream=hello-openshift --binary=true --name=sheng
warning: Cannot find git. Ensure that it is installed and in your path. Git is required to work with git repositories.
--> Found image 7af3297 (20 months old) in image stream "shp/hello-openshift" under tag "latest" for "hello-openshift"

    * A Docker build using binary input will be created
      * The resulting image will be pushed to image stream "sheng:latest"
      * A binary build was created, use 'start-build --from-dir' to trigger a new build

--> Creating resources with label build=sheng ...
    imagestream "sheng" created
    buildconfig "sheng" created
--> Success
[root@test3 ~]# oc get is
NAME              DOCKER REPO   TAGS      UPDATED
hello-openshift                 latest    9 weeks ago
sheng                                     
[root@test3 ~]# 

4: 下面看一下应用:

[root@test3 ~]# oc get dc
NAME              REVISION   DESIRED   CURRENT   TRIGGERED BY
hello-openshift   1          1         1         config,image(hello-openshift:latest)
发现还没有新的image 还么有开始被使用:

[root@test3 scripts]# oc start-build sheng --from-dir=/tool/scripts
Uploading directory "/tool/scripts" as binary input for the build ...

如果成功以后,就可以看到dc 拉:

[root@test3 ~]# oc get dc
 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shenghuiping2001

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值