打包时报错
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=f45sm8ytsp9vn49r8q2eawie3&shmsize=0&t=hudongtang-cms&target=&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied
Build step 'Execute shell' marked build as failure
Finished: FAILURE
执行下面的命令
sudo gpasswd -a jenkins docker
newgrp docker
sudo service jenkins restart
博主是放在jenkins上跑的吗?我也碰到这个问题,因为newgrp命令其实会新开一个seesion,而在jenkins中还是在原先的seesion环境中并没有切换过去,所以导致docker组里面的成员没有刷新,唉 我目前也不知道有什么好的办法把他脚本化