jenkins执行mvn docker:build报这样的错,是因为docker没有运行起来,执行

报错信息

log
14:15:55 [INFO] Copying /var/lib/jenkins/workspace/test/default/register-center/eureka-server/target/eureka-server.jar -> /var/lib/jenkins/workspace/test/default/register-center/eureka-server/target/docker/eureka-server.jar
14:16:15 [INFO] Copying src/main/docker/Dockerfile -> /var/lib/jenkins/workspace/test/default/register-center/eureka-server/target/docker/Dockerfile
14:16:15 [INFO] Building image yecl1/eureka-server
14:16:15 Mar 13, 2021 2:16:18 PM org.apache.http.impl.execchain.RetryExec execute
14:16:18 INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: No such file or directory
14:16:18 Mar 13, 2021 2:16:18 PM org.apache.http.impl.execchain.RetryExec execute
14:16:18 INFO: Retrying request to {}->unix://localhost:80
14:16:18 Mar 13, 2021 2:16:18 PM org.apache.http.impl.execchain.RetryExec execute
14:16:18 INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: No such file or directory
14:16:18 Mar 13, 2021 2:16:18 PM org.apache.http.impl.execchain.RetryExec execute
14:16:18 INFO: Retrying request to {}->unix://localhost:80
14:16:18 Mar 13, 2021 2:16:18 PM org.apache.http.impl.execchain.RetryExec execute
14:16:18 INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: No such file or directory
14:16:18 Mar 13, 2021 2:16:18 PM org.apache.http.impl.execchain.RetryExec execute
14:16:18 INFO: Retrying request to {}->unix://localhost:80
14:16:18 [INFO] ------------------------------------------------------------------------
14:16:18 [INFO] BUILD FAILURE
14:16:18 [INFO] ------------------------------------------------------------------------
14:16:18 [INFO] Total time: 01:47 min
14:16:18 [INFO] Finished at: 2021-03-13T14:16:18+08:00
14:16:18 [INFO] ------------------------------------------------------------------------
14:16:18 [ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.13:build (default-cli) on project eureka-server: 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]
14:16:18 [ERROR]
14:16:18 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
14:16:18 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
14:16:18 [ERROR]
14:16:18 [ERROR] For more information about the errors and possible solutions, please read the following articles:
14:16:18 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
14:16:18 Build step ‘Execute shell’ marked build as failure
14:16:18 Finished: FAILURE

image-1655183033083

yum install -y docker
systemctl start docker

再执行一次即可。

Q.E.D.


知之为知之