Make Jenkins run docker without sudo

后端 未结 4 856
小鲜肉
小鲜肉 2020-12-11 03:34

I would like to run Docker shell commands on Jenkins like:

docker ps

Is it possible to do it with out using any plugi

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 04:25

    I had the issue when I was running from jenkins pipeline. I added jenkins user to docker group, restarted the docker engine and rebooted the machine as well. However I still get the same error dial unix /var/run/docker.sock: connect: permission denied.

    Finally I added jenkins to root group and it resolved my issue (ubuntu 18.04) (VM on Azure)

    sudo gpasswd -a jenkins root
    sudo service docker restart
    

提交回复
热议问题