mvn clean package docker:build之后,镜像上传到仓库了,但是harbor中没有

Blade 已结 2 119
keqi7878
keqi7878 剑童 2024-11-01 10:14

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

  1. 这是仓库服务器的daemon.json

    image.png

    这是客户端的daemon.json

    image.png
    这是maven的setting

image.png

  1. 这是pom文件

    image.png

2.maven添加-X参数后的结果:

(完整命令为在根目录下执行:mvn clean package docker:build -X)

The push refers to repository [8.134.90.11/blade/blade-auth]

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary for ydj-cloud 4.2.0:

[INFO]

[INFO] ydj-cloud .......................................... SUCCESS [  3.164 s]

[INFO] blade-common ....................................... SUCCESS [  9.197 s]

[INFO] blade-service-api .................................. SUCCESS [  1.334 s]

[INFO] blade-user-api ..................................... SUCCESS [  6.237 s]

[INFO] blade-auth ......................................... FAILURE [04:58 min]

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

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

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

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

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

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

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

[INFO] blade-seata-order .................................. SKIPPED

[INFO] blade-seata-storage ................................ SKIPPED

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

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

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

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

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

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

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

[INFO] blade-demo-api ..................................... SKIPPED

[INFO] blade-demo ......................................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  05:22 min

[INFO] Finished at: 2024-11-01T09:53:55+08:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project blade-auth: Exception caught: Get "http://8.134.90.11/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project blade-auth: Exception caught

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

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

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

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

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

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

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

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)

    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)

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

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

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

    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)

    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke (Method.java:568)

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

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

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

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

Caused by: org.apache.maven.plugin.MojoExecutionException: Exception caught

    at com.spotify.docker.AbstractDockerMojo.execute (AbstractDockerMojo.java:151)

    at com.spotify.docker.BuildMojo.execute (BuildMojo.java:324)

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

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

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

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

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

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

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

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

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)

    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)

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

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

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

    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)

    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke (Method.java:568)

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

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

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

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

Caused by: com.spotify.docker.client.exceptions.DockerException: Get "http://8.134.90.11/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

    at com.spotify.docker.client.AnsiProgressHandler.progress (AnsiProgressHandler.java:55)

    at com.spotify.docker.Utils$DigestExtractingProgressHandler.progress (Utils.java:189)

    at com.spotify.docker.client.ProgressStream.tail (ProgressStream.java:77)

    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2734)

    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2718)

    at java.util.concurrent.FutureTask.run (FutureTask.java:264)

    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)

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

    at java.lang.Thread.run (Thread.java:833)

[ERROR]

[ERROR]

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

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

[ERROR]

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

[ERROR]   mvn <args> -rf :blade-auth

3.虽然失败了,但是在仓库服务器能看到这个镜像,但是在harbor中看不到

image.png

image.png



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

harbor测试推送环节没问题

image.png

image.png


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

产品:SpringBlade 4.2.0

仓库系统:centos7.9 64位

客户端:win11

仓库dockr版本:26.1.4

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


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


2条回答
  •  admin
    admin (最佳回答者)
    2024-11-01 10:40

    他是要先全部构建完才会执行推送命令的。你把构建期间报错的问题解决应该就可以了。

    主要报错原因如下,可能还是网络或者加速的配置问题:

    Caused by: com.spotify.docker.client.exceptions.DockerException: Get "http://8.134.90.11/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)


    作者追问:2024-11-01 10:40

    这个是curl的情况:image.png

    这个是mvn clean package执行的情况:

    image.png

    都挺正常的,就是mvn clean package docker:build到第一个镜像推送到harbor的问题一直在,中间试过重启两端的docker,也是不行

    0 讨论(1)
  • 2024-11-01 17:19

    已解决,原因是阿里云服务器的80端口没有对服务器自己开安全组策略,感谢大佬回复

    0 讨论(0)
提交回复