Openshift oc new-app命令getsockopt:连接被拒绝错误

时间:2016-04-14 22:52:22

标签: docker openshift

我正在运行带有Docker注册表和Openshift Origin图像的RHEL VM:

[root@mtl-vm375 ~]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                          NAMES
e43274649d1d        registry:2          "/bin/registry /etc/d"   13 minutes ago      Up 13 minutes       0.0.0.0:443->443/tcp, 0.0.0.0:5000->5000/tcp   registry
d819059266fa        openshift/origin    "/usr/bin/openshift s"   29 hours ago        Up 7 hours                                                         origin

我可以成功从VM本身通过docker pull localhost:5000 / cowsay-dockerfile:2.0

但是,在Origin容器中,new-app的等效命令失败:

[root@mtl-vm375 origin]# oc new-app cowsay-dockerfile:2.0
error: can't look up Docker image "cowsay-dockerfile:2.0": Internal error occurred: Get https://registry-1.docker.io/v2/: dial tcp 10.230.22.20:443: getsockopt: connection refused
error: no match for "cowsay-dockerfile:2.0"

我尝试过各种参数到new-app,有和没有2.0标签,以及如下(使用不安全的注册表来开始):

[root@mtl-vm375 origin]# oc new-app http://mtl-vm375:5000/cowsay-dockerfile
error: unable to load template file "http://mtl-vm375:5000/cowsay-dockerfile": unable to read URL "http://mtl-vm375:5000/cowsay-dockerfile", server reported 404 404 Not Found
error: no match for "http://mtl-vm375:5000/cowsay-dockerfile"

我觉得我必须接近将图像变成Openshift Origin,但需要有人的神奇触摸才能知道缺少什么。

版本信息:     [root @ mtl-vm375 origin] #oc version     oc v1.1.5-52-gd58f979     kubernetes v1.2.0-36-g4a3f9c5

[root@mtl-vm375 ~]# docker version
Client:
 Version:      1.8.2-el7.centos
 API version:  1.20
 Package Version: docker-1.8.2-10.el7.centos.x86_64
 Go version:   go1.4.2
 Git commit:   a01dc02/1.8.2
 Built:
 OS/Arch:      linux/amd64

Server:
 Version:      1.8.2-el7.centos
 API version:  1.20
 Package Version:
 Go version:   go1.4.2
 Git commit:   a01dc02/1.8.2
 Built:
 OS/Arch:      linux/amd64

谢谢, 约翰

1 个答案:

答案 0 :(得分:1)

你需要使用" - docker-image"参数;如下所示:

oc new-app --docker-image=mtl-vm375:5000/cowsay-dockerfile

" oc帮助new-app"查看更多选项和其他故障排除命令。