Origin: Unable to push image to integrete docker registry

Created on 19 Dec 2016  路  4Comments  路  Source: openshift/origin

I start openshift(all in one)by using : openshift start --loglevel=4 &> /root/openshift.log &
and --insecure-registry has been config like this:
[root@openshift-node ~]# vim /etc/sysconfig/docker

# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled'
OPTIONS='--insecure-registry registry:5000'
OPTIONS='--insecure-registry 172.30.0.0/16' 

[root@openshift-node ~]#oadm registry -n default
[root@openshift-node ~]# oc describe svc/docker-registry -n default

Name:                   docker-registry
Namespace:              default
Labels:                 docker-registry=default
Selector:               docker-registry=default
Type:                   ClusterIP
IP:                     172.30.25.243
Port:                   5000-tcp        5000/TCP
Endpoints:              172.17.0.3:5000
Session Affinity:       ClientIP
No events.                     

[root@openshift-node ~]# oc new-app --docker-image="openshift/ruby-22-centos7:latest"~http://10.62.55.215:8080/git/lgx/ruby-ex
[root@openshift-node ~]# oc get all

NAME         TYPE      FROM      LATEST
bc/ruby-ex   Source    Git       2

NAME               TYPE      FROM          STATUS    STARTED         DURATION
builds/ruby-ex-1   Source    Git@8e9386c   Failed    6 minutes ago   1m7s
builds/ruby-ex-2   Source    Git@8e9386c   Failed    5 minutes ago   4m14s

NAME         DOCKER REPO                              TAGS      UPDATED
is/ruby-ex   172.30.25.243:5000/lgx-project/ruby-ex

NAME         REVISION   DESIRED   CURRENT   TRIGGERED BY
dc/ruby-ex   0          1         0         config,image(ruby-ex:latest)

NAME          CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
svc/ruby-ex   172.30.111.250   <none>        8080/TCP   7m

NAME                 READY     STATUS    RESTARTS   AGE
po/ruby-ex-1-build   0/1       Error     0          7m
po/ruby-ex-2-build   0/1       Error     0          5m 

[root@openshift-node ~]# docker logs ae5eff286a91 (sti-container-id)

Using HTTP proxy http://proxysh.zte.com.cn:80 and HTTPS proxy http://proxysh.zte.com.cn:80 for script download
Cloning "http://10.62.55.215:8080/git/lgx/ruby-ex" ...
        Commit: 8e9386c54b6e148b5a20449f219a1572a1d9e798 (submit ruby-ex)
        Author: guangxuli <[email protected]>
        Date:   Thu Dec 15 19:45:36 2016 +0800

---> Installing application source ...
---> Building your Ruby application from source ...
---> Running 'bundle install --deployment' ...
Fetching gem metadata from https://rubygems.org/...............
Installing puma 3.4.0
Installing rack 1.6.4
Using bundler 1.7.8
Your bundle is complete!
It was installed into ./bundle
---> Cleaning up unused ruby gems ...


Pushing image 172.30.25.243:5000/lgx-project/ruby-ex:latest ...
Registry server Address:
Registry server User Name: serviceaccount
Registry server Email: [email protected]
Registry server Password: <<non-empty>>
error: build error: Failed to push image: Get https://172.30.25.243:5000/v1/_ping: unexpected EOF

[root@openshift-node ~]# oc project
Using project "lgx-project" on server "https://localhost:8443".
[root@openshift-node ~]# oc version

oc v1.5.0-alpha.0+37762d3-442
kubernetes v1.4.0+776c994
features: Basic-Auth

Server https://localhost:8443
openshift v1.5.0-alpha.0+37762d3-442
kubernetes v1.4.0+776c994       
componenimageregistry kinquestion prioritP3

Most helpful comment

@guangxuli I still have the problem with "pushing to the local registry". I get this error when trying to push the image to the registry :
"Failed to push image: Get http://172.30.1.1:5000/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)"

could you please tell me how you fixed your problem?

All 4 comments

i try another test follow the example:
https://github.com/openshift/origin/tree/master/examples/sample-app

the output of sti builder:

[root@openshift-node sample-app]# docker logs b7635867dd77
Using HTTP proxy http://proxysh.zte.com.cn:80 and HTTPS proxy http://proxysh.zte.com.cn:80 for script download
Cloning "http://10.62.55.215:8080/git/lgx/ruby-ex.git" ...
        Commit: 8e9386c54b6e148b5a20449f219a1572a1d9e798 (submit ruby-ex)
        Author: guangxuli <[email protected]>
        Date:   Thu Dec 15 19:45:36 2016 +0800

---> Installing application source ...
---> Building your Ruby application from source ...
---> Running 'bundle install --deployment' ...
Fetching gem metadata from https://rubygems.org/...............
Installing puma 3.4.0
Installing rack 1.6.4
Using bundler 1.7.8
Your bundle is complete!
It was installed into ./bundle
---> Cleaning up unused ruby gems ...


Pushing image openshift/origin-ruby-sample-lgx:latest ...
error: build error: Failed to push image: unauthorized: authentication required  

i saw the issue https://github.com/openshift/origin/issues/4518 and https://github.com/openshift/origin/issues/4676
but I still have this problem. :(

my bc content:

{
    "kind": "BuildConfig",
    "apiVersion": "v1",
    "metadata": {
        "name": "ruby-sample-build",
        "namespace": "test",
        "selfLink": "/oapi/v1/namespaces/test/buildconfigs/ruby-sample-build",
        "uid": "16543e66-c820-11e6-b041-fa163e986f2f",
        "resourceVersion": "1237",
        "creationTimestamp": "2016-12-22T08:24:42Z",
        "labels": {
            "app": "ruby-helloworld-sample",
            "name": "ruby-sample-build",
            "template": "application-template-stibuild"
        },
        "annotations": {
            "openshift.io/generated-by": "OpenShiftNewApp"
        }
    },
    "spec": {
        "triggers": [
            {
                "type": "GitHub",
                "github": {
                    "secret": "secret101"
                }
            },
            {
                "type": "Generic",
                "generic": {
                    "secret": "secret101",
                    "allowEnv": true
                }
            },
            {
                "type": "ConfigChange"
            }
        ],
        "runPolicy": "Serial",
        "source": {
            "type": "Git",
            "git": {
                "uri": "http://10.62.55.215:8080/git/lgx/ruby-ex.git"
            }
        },
        "strategy": {
            "type": "Source",
            "sourceStrategy": {
                "from": {
                    "kind": "DockerImage",
                    "name": "openshift/ruby-22-centos7:latest"
                },
                "env": [
                    {
                        "name": "EXAMPLE",
                        "value": "sample-app"
                    },
                    {
                        "name": "http_proxy",
                        "value": "http://proxysh.zte.com.cn:80"
                    },
                    {
                        "name": "https_proxy",
                        "value": "http://proxysh.zte.com.cn:80"
                    }
                ]
            }
        },
        "output": {
            "to": {
                "kind": "DockerImage",
                "name": "openshift/origin-ruby-sample-lgx:latest"
            }
        },
        "resources": {},
        "postCommit": {},
        "nodeSelector": null
    },
    "status": {
        "lastVersion": 3
    }
}                     

I have blocked by this problem for several days. @legionus @ncdc @bparees could you help me? thanks.

@guangxuli you've listed 2 different issues. In the initial report, you got an EOF trying to talk to the integrated registry. I noticed that you're using an HTTP proxy. Did you specify the integrated registry's IP address in the NO_PROXY setting (https://docs.openshift.org/latest/install_config/http_proxies.html#proxying-docker-pull)?

In your sample-app example, you have the BuildConfig's spec.output.to.kind set to DockerImage, which means that OpenShift will attempt to push to whatever you've specified, which in this case is openshift/origin-ruby-sample-lgx:latest. It pushes to exactly that spec, so if you don't specify a registry, it will attempt to push to the docker hub, which is what it's doing in this case. If you want to push to the integrated registry, you need to set spec.output.to.kind to ImageStreamTag. See https://docs.openshift.org/latest/dev_guide/builds.html#build-output for more details.

@ncdc thanks, i got it. :)

@guangxuli I still have the problem with "pushing to the local registry". I get this error when trying to push the image to the registry :
"Failed to push image: Get http://172.30.1.1:5000/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)"

could you please tell me how you fixed your problem?

Was this page helpful?
0 / 5 - 0 ratings