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
- https://docs.docker.com/registry/deploying/
- https://jenkins.io/doc/book/pipeline/docker/#custom-registry
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'
}
}
}
}