error: fatal: unable to access 'https://github.com/openshift/cakephp-ex.git/': Could not resolve ho

System Environment

  1. Run as root.

    Currently OpenShift v3 must be started as root in order to manipulate your iptables configuration. The openshift commands (e.g. oc create) do not need to be run as root.

  2. Properly configure or disable firewalld.

    On Fedora or other distributions using firewalld: Add docker0 to the public zone

     $ firewall-cmd --zone=trusted --change-interface=docker0
     $ systemctl restart firewalld
    

    Alternatively you can disable it via:

     $ systemctl stop firewalld . -- this is the solution for me
    
  3. Setup your host DNS to an address that the containers can reach

Containers need to be able to resolve hostnames, so if you run a local DNS server on your host, you should update your /etc/resolv.conf to instead use a DNS server that will be reachable from within running containers. Google's "8.8.8.8" server is a popular choice.

  1. Save iptables rules before restarting iptables and restore them afterwards. If iptables have to be restarted, then the iptables rules should be saved and restored, otherwise the docker inserted rules would get lost:

     $ iptables-save > /path/to/iptables.bkp
     $ systemctl restart iptables
     $ iptables-restore < /path/to/iptables.bkp
    

Build Failures

To investigate a build failure, first check the build logs. You can view the build logs via:

$ oc logs build/[build_id]

and you can get the build id via:

$ oc get builds

the build id is in the first column.

If you're unable to retrieve the logs in this way, you can also get them directly from docker. First you need to find the docker container that ran your build:

$ docker ps -a | grep builder

The most recent container in that list should be the one that ran your build. The container id is the first column. You can then run:

$ docker logs [container id]

Hopefully the logs will provide some indication of what it failed (e.g. failure to find the source repository, an actual build issue, failure to push the resulting image to the docker registry, etc).

One issue seen sometimes is not being able to resolve any hostname (for example github.com) from within running containers:

E0708 17:28:07.845231       1 git.go:102] fatal: unable to access 'https://github.com/gabemontero/cakephp-ex.git/': Could not resolve host: github.com; Unknown error

If this shows up in your build logs, restart docker and then resubmit a build:

$ sudo systemctl restart docker
$ oc start-build --from-build=<your build identifier>


阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页