Created
November 3, 2016 02:58
-
-
Save diatmpravin/b55a133c508e97071b04ed6c099cd562 to your computer and use it in GitHub Desktop.
Jenkins: Can't connect to Docker daemon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After the installation of Jenkins and Docker. Add jenkins user to dockergroup (like you did) | |
sudo gpasswd -a jenkins docker | |
Edit the following file | |
vi /usr/lib/systemd/system/docker.service | |
And edit this rule to expose the API : | |
ExecStart=/usr/bin/docker daemon -H unix:// -H tcp://localhost:2375 | |
Now it's time to reload and restart your Docker daemon | |
systemctl daemon-reload | |
systemctl restart docker | |
Then I restarted jenkins and I was able to perform docker commands as jenkins user in my jenkins jobs | |
sudo service jenkins restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment