使用docker-maven-plugin进行构建镜像报错如下:
com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied
解决方案 :
Add the docker group if it doesn’t already exist:
sudo groupadd docker #增加docker组,如果存在,跳过
Add the connected user “$USER” to the docker group. Change the user name to match your preferred user if you do not want to use your current user:
sudo usermod -aG docker jenkins #将jenkins用户添加到docker组
Provide the /var/run/docker.sock socket and /var/run/docker directory the proper permissions to make it work:
sudo chown root:docker /var/run/docker.sock #docker.sock的权限修改
sudo chown -R root:docker /var/run/docker
If the above commands do not resolve your issue try to run the below command from root:
chmod 666 /var/run/docker.sock
标签:run,Permission,sudo,sock,maven,user,var,80,docker
From: https://www.cnblogs.com/linuxk/p/18224661