0

I am running a docker registry locally on my machine, and I can pull my image from it successfully:

docker pull 192.168.174.205:5001/myimg:latest

I am also running a jenkins container on my machine, but Jenkins cannot pull any image from the local registry. I use a Blue Ocean container (on the same machine) to start a pipeline, and it outputs:

+ docker pull 192.168.174.205:5001/insureio:latest
Error response from daemon: Get https://192.168.174.205:5001/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
script returned exit code 1

TMI

Specs

  • Docker version 1.13.1, build 4ef4b30/1.13.1
  • Jenkins ver. 2.204.2
  • host CentOS Linux 7 (Core)

Reference

I have been working from the instructions on

Settings

My /etc/docker/daemon.json file reads {"insecure-registries" : ["192.168.174.205:5001"]}.

The local registry gives a 200 response:

curl http://192.168.174.205:5001/v2/_catalog
{"repositories":["mying"]}

My pipeline script is:

node {
  stage('Build') {
    docker.withRegistry('http://192.168.174.205:5001') {
      docker.image('insureio:latest').inside('') {
        sh 'make test'
      }
    }
  }
}
Community
  • 1
  • 1
JellicleCat
  • 28,480
  • 24
  • 109
  • 162

1 Answers1

0

Since both Jenkins and your registry are containers, Jenkins is going to be looking at the 192.168.174.205 IP address at its own network space.

If you're just trying things out, I would suggest doing a docker inspect <your registry container> | grep -i ipaddress to find its IP address (by default it should be in the region of 172.17.XXX.XXX) and configure your pipeline to use that address.

Sakis Vtdk
  • 489
  • 6
  • 12
  • Thanks very much, but with that change, I get `Error response from daemon: Get https://172.17.0.2:5001/v2/: dial tcp 172.17.0.2:5001: connect: no route to host`. Do you have an idea what the matter might be? – JellicleCat Feb 27 '20 at 18:10
  • 1
    I see it tries to do an `https` connection? A faster way to debug this would be to get a shell on your jenkins container, something like `docker exec -it sh` and run various `curl` commands from within the container. – Sakis Vtdk Feb 27 '20 at 18:41