Issue with docker executors in Jenkins

42 views
Skip to first unread message

Mus K

unread,
Oct 29, 2019, 10:12:56 PM10/29/19
to Jenkins Users
Hi - I am facing the following issue in Jenkins ver. 2.190.2.

I have installed docker plugin and setup a docker executor thru Manage Jenkins -> Configure System
I have set the agent correctly in Jenkinsfile and the checkout and build pipeline stages are executing correctly. However, when I run tests that involve creating temporary docker containers, the pipeline fails with error "panic: : dial unix: missing address"
I tried troubleshooting this and the slave container is not able to accessdiscovered its not able to access the host docker daemon. I verified in the container settings that the following mapping is present for volumes  
/var/run/docker.sock:/var/run/docker.sock

I tried putting commands in Jenkinsfile e.g. docker images and I get 

Cannot connect to the Docker daemon at unix://127.0.0.1:2376. Is the docker daemon running?
script returned exit code 1


Surprisingly though, if I docker exec into the same running container I am able to successfully run docker commands that access the host's docker daemon. 
Only the docker commands in the Jenkinsfile are unable to access the host docker daemon. I also verified the container mounts using docker inspect and the volume mapping for docker.sock is present.  

Some information about the environment
Host - Ubuntu 18.04 (AWS EC2)
Docker CE - 19.03
Jenkins 2.190.2

Any help is appreciated as I have exhausted all my options. 

Sai krishna reddy karri

unread,
Nov 1, 2019, 8:14:57 AM11/1/19
to Jenkins Users
so first have you updated the docker host uri option within docker file under /etc/default/docker ?

that looks something like this -H tcp://127.0.0.1:2376 -H .

after adding this in the end line try restarting docker and then check
Reply all
Reply to author
Forward
0 new messages