mvn clean package dockerfile:build dockerfile:push报错

Blade 已结 1 885
380999444
380999444 剑圣 2021-05-10 10:30

一、该问题的重现步骤是什么?

  1.  mvn clean package dockerfile:build dockerfile:push 按照教程一步一步操作,报错,用的是2.7.0版本

  2. 252.127/blade/blade-auth:2.7.0.RELEASE

  3. [INFO]

  4. [WARNING] An attempt failed, will retry 1 more times

  5. org.apache.maven.plugin.MojoExecutionException: Could not build image

  6.         at com.spotify.plugin.dockerfile.BuildMojo.buildImage(BuildMojo.java:234)

  7.         at com.spotify.plugin.dockerfile.BuildMojo.execute(BuildMojo.java:129)

  8.         at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute(AbstractDockerMojo.java:265)

  9.         at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute(AbstractDockerMojo.java:254)

  10.         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)

  11.         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)

  12.         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

  13.         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

  14.         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)

  15.         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)

  16.         at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)

  17.         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)

  18.         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)

  19.         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)

  20.         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)

  21.         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)

  22.         at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)

  23.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  24.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

  25.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  26.         at java.lang.reflect.Method.invoke(Method.java:498)

  27.         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)

  28.         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)

  29.         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)

  30.         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

  31. Caused by: com.spotify.docker.client.exceptions.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.d

  32. ocker.client.shaded.org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

  33.         at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2828)

  34.         at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2692)

  35.         at com.spotify.docker.client.DefaultDockerClient.version(DefaultDockerClient.java:580)

  36.         at com.spotify.docker.client.DefaultDockerClient.authRegistryHeader(DefaultDockerClient.java:2871)

  37.         at com.spotify.docker.client.DefaultDockerClient.build(DefaultDockerClient.java:1478)

  38.         at com.spotify.docker.client.DefaultDockerClient.build(DefaultDockerClient.java:1445)

  39.         at com.spotify.plugin.dockerfile.BuildMojo.buildImage(BuildMojo.java:227)

  40.         ... 24 more

  41. Caused by: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.conn.HttpHostConne

  42. ctException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

  43.         at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)

  44.         at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)

  45.         at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)

  46.         at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2690)

  47.         ... 29 more

  48. Caused by: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [l

  49. ocalhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

  50.         at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:481)

  51.         at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector$1.run(ApacheConnector.java:491)

  52.         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

  53.         at java.util.concurrent.FutureTask.run(FutureTask.java:266)

  54.         at jersey.repackaged.com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299)

  55.         at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)

  56.         at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:50)

  57.         at jersey.repackaged.com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:37)

  58.         at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:487)

  59.         at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:178)

  60.         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)

  61.         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)

  62.         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:315)

  63.         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:297)

  64.         at com.spotify.docker.client.shaded.org.glassfish.jersey.internal.Errors.process(Errors.java:267)

  65.         at com.spotify.docker.client.shaded.org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:340)

  66.         at com.spotify.docker.client.shaded.org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:210)

  67.         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

  68.         at java.util.concurrent.FutureTask.run(FutureTask.java:266)

  69.         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

  70.         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

  71.         at java.lang.Thread.run(Thread.java:748)

  72. Caused by: com.spotify.docker.client.shaded.org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection

  73. refused: connect

  74.         at com.spotify.docker.client.shaded.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)

  75.         at com.spotify.docker.client.shaded.org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)

  76.         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)

  77.         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)

  78.         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)

  79.         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)

  80.         at com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)

  81.         at com.spotify.docker.client.shaded.org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)

  82.         at com.spotify.docker.client.shaded.org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)

  83.         at com.spotify.docker.client.shaded.org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:435)

  84.         ... 21 more

  85. Caused by: java.net.ConnectException: Connection refused: connect

  86.         at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)

  87.         at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)

  88.         at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

  89.         at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

  90.         at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

  91.         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

  92.         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

  93.         at java.net.Socket.connect(Socket.java:589)

  94.         at com.spotify.docker.client.shaded.org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)

  95.         at com.spotify.docker.client.shaded.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)

  96.         ... 30 more

  97. [INFO] dockerfile: null

  98. [INFO] contextDirectory: D:\project\BladeX_1.1\blade-auth

  99. [INFO] Building Docker context D:\project\BladeX_1.1\blade-auth

  100. [INFO] Path(dockerfile): null

  101. [INFO] Path(contextDirectory): D:\project\BladeX_1.1\blade-auth

  102. [INFO]

  103. [INFO] Image will be built as 192.168.252.127/blade/blade-auth:2.7.0.RELEASE

  104. [INFO]

  105. [INFO] ------------------------------------------------------------------------

  106. [INFO] Reactor Summary:

  107. [INFO]

  108. [INFO] BladeX ............................................. SUCCESS [  1.099 s]

  109. [INFO] blade-common ....................................... SUCCESS [  2.268 s]

  110. [INFO] blade-service-api .................................. SUCCESS [  0.372 s]

  111. [INFO] blade-user-api ..................................... SUCCESS [  2.130 s]

  112. [INFO] blade-system-api ................................... SUCCESS [  2.179 s]

  113. [INFO] blade-auth ......................................... FAILURE [ 26.759 s]

  114. [INFO] blade-gateway ...................................... SKIPPED

  115. [INFO] blade-ops .......................................... SKIPPED

  116. [INFO] blade-admin ........................................ SKIPPED

  117. [INFO] blade-dict-api ..................................... SKIPPED

  118. [INFO] blade-develop ...................................... SKIPPED

  119. [INFO] blade-scope-api .................................... SKIPPED

  120. [INFO] blade-ops-api ...................................... SKIPPED

  121. [INFO] blade-flow-api ..................................... SKIPPED

  122. [INFO] blade-flow ......................................... SKIPPED

  123. [INFO] blade-flow-design .................................. SKIPPED

  124. [INFO] blade-log .......................................... SKIPPED

  125. [INFO] blade-report ....................................... SKIPPED

  126. [INFO] blade-resource-api ................................. SKIPPED

  127. [INFO] blade-resource ..................................... SKIPPED

  128. [INFO] blade-turbine ...................................... SKIPPED

  129. [INFO] blade-xxljob ....................................... SKIPPED

  130. [INFO] blade-xxljob-admin ................................. SKIPPED

  131. [INFO] blade-desk-api ..................................... SKIPPED

  132. [INFO] blade-service ...................................... SKIPPED

  133. [INFO] blade-desk ......................................... SKIPPED

  134. [INFO] blade-system ....................................... SKIPPED

  135. [INFO] blade-user ......................................... SKIPPED

  136. [INFO] blade-standard-api ................................. SKIPPED

  137. [INFO] blade-standard ..................................... SKIPPED

  138. [INFO] blade-assets-api ................................... SKIPPED

  139. [INFO] blade-inceptor-api ................................. SKIPPED

  140. [INFO] blade-assets ....................................... SKIPPED

  141. [INFO] blade-dashboard-api ................................ SKIPPED

  142. [INFO] blade-dashboard .................................... SKIPPED

  143. [INFO] blade-personalize-api .............................. SKIPPED

  144. [INFO] blade-personalize .................................. SKIPPED

  145. [INFO] blade-inceptor ..................................... SKIPPED

  146. [INFO] blade-quality-api .................................. SKIPPED

  147. [INFO] blade-quality ...................................... SKIPPED

  148. [INFO] blade-openapi-api .................................. SKIPPED

  149. [INFO] blade-openapi ...................................... SKIPPED

  150. [INFO] ------------------------------------------------------------------------

  151. [INFO] BUILD FAILURE

  152. [INFO] ------------------------------------------------------------------------

  153. [INFO] Total time: 43.153 s

  154. [INFO] Finished at: 2021-05-10T10:25:14+08:00

  155. [INFO] Final Memory: 185M/1685M

  156. [INFO] ------------------------------------------------------------------------

  157. [ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.10:build (default-cli) on project blade-auth: Could not build image: java.util.concurrent.ExecutionException: com.

  158. spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.

  159. 0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect -> [Help 1]

  160. [ERROR]

  161. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

  162. [ERROR] Re-run Maven using the -X switch to enable full debug logging.

  163. [ERROR]

  164. [ERROR] For more information about the errors and possible solutions, please read the following articles:

  165. [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

  166. [ERROR]

  167. [ERROR] After correcting the problems, you can resume the build with the command

  168. [ERROR]   mvn <goals> -rf :blade-auth

2. 

3.


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。

1条回答
  •  admin
    admin (最佳回答者)
    2021-05-10 16:04

    主要错误如下

    spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.
    0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

    连不上本地的2375端口,2375端口是docker进程守护端口,你本地安装了docker么?

    如果不是的话,查一下配置,把docker推送地址改为服务器

    0 讨论(2)
提交回复