(java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied

jenkines 部署docker 服务报错

Nov 15, 2019 11:12:11 AM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied
Nov 15, 2019 11:12:11 AM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->unix://localhost:80
Nov 15, 2019 11:12:11 AM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied
Nov 15, 2019 11:12:11 AM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->unix://localhost:80
Nov 15, 2019 11:12:11 AM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied
Nov 15, 2019 11:12:11 AM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->unix://localhost:80

解决方案:改变目录权限

  chmod 777 /var/run/docker.sock
  
  或者
  
  usermod -a -G docker jenkins
    

执行 build images 时,报错情况一:

Building image mavendemo
org.apache.http.impl.execchain.RetryExec execute
I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: No such file or directory
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project mavenDemo: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: No such file or directory -> [Help 1]

这个是因为 Docker 服务没有启动造成的,启动 Docker 即可。
如果是在Jenkins下遇见这个错误,要看jenkins 是否有运行docker的权限

你可能感兴趣的:((java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied)