Docker connection is refused in Jenkins

The issue was from Docker configuration. In Ubuntu 18.04 Docker configuration is located in /lib/systemd/system/docker.service Then I need to update to enable Docker daemon connection from Jenkins.

ExecStart=/usr/bin/docker daemon -H fd://

I updated the configuration above to a new configuration below. ExecStart=/usr/bin/docker daemon -H fd:// -D -H tcp://0.0.0.0:2375 The I restarted Docker daemon. sudo systemctl daemon-reload sudo systemctl restart docker

Now it worked. Jenkins can connect the Docker daemon now.

Leave a Reply