项目使用mvn dockerfile:build dockerfile:push推送到harbor报错

Blade 未结 1 967
广东恒电
广东恒电 剑圣 2020-12-29 09:19

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

  1.  项目使用mvn dockerfile:build dockerfile:push推送到harbor

   Docker文件:

FROM adoptopenjdk/openjdk8-openj9:alpine-slim

MAINTAINER smallchill@163.com

RUN mkdir -p /hengdian

WORKDIR /hengdian

EXPOSE 8045

ADD ./target/hengdian-psychology-remedy.jar ./app.jar

RUN echo -e "http://mirrors.aliyun.com/alpine/v3.6/main\nhttp://mirrors.aliyun.com/alpine/v3.6/community" > /etc/apk/repositories

RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig

ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]

CMD ["--spring.profiles.active=test"]
[INFO] --- dockerfile-maven-plugin:1.4.13:build (default-cli) @ hengdian-psychology-remedy ---
[INFO] dockerfile: null
[INFO] contextDirectory: E:\project\idea\hengdian-mind\blade-service\hengdian-psychology-remedy
[INFO] Building Docker context E:\project\idea\hengdian-mind\blade-service\hengdian-psychology-remedy
[INFO] Path(dockerfile): null
[INFO] Path(contextDirectory): E:\project\idea\hengdian-mind\blade-service\hengdian-psychology-remedy
[INFO]
[INFO] Image will be built as 192.168.23.221/blade/hengdian-psychology-remedy:2.6.0.RELEASE
[INFO]
[INFO] Step 1/10 : FROM adoptopenjdk/openjdk8-openj9:alpine-slim
[INFO]
[INFO] Pulling from adoptopenjdk/openjdk8-openj9
[INFO] Digest: sha256:2f4b583fb7e4a01c09d7f9771fe021bceace623b6edd5e822269ad6dee74f6a3
[INFO] Status: Image is up to date for adoptopenjdk/openjdk8-openj9:alpine-slim
[INFO]  ---> 440045c41637
[INFO] Step 2/10 : MAINTAINER smallchill@163.com
[INFO]
[INFO]  ---> Using cache
[INFO]  ---> f0fd24a7c49c
[INFO] Step 3/10 : RUN mkdir -p /hengdian
[INFO]
[INFO]  ---> Using cache
[INFO]  ---> b53004e150e3
[INFO] Step 4/10 : WORKDIR /hengdian
[INFO]
[INFO]  ---> Using cache
[INFO]  ---> 84fbb96db6fe
[INFO] Step 5/10 : EXPOSE 8045
[INFO]
[INFO]  ---> Using cache
[INFO]  ---> fb0c33c4d231
[INFO] Step 6/10 : ADD ./target/hengdian-psychology-remedy.jar ./app.jar
[INFO]
[INFO]  ---> bdbe4ee8a6e0
[INFO] Step 7/10 : RUN echo -e "http://mirrors.aliyun.com/alpine/v3.6/main\nhttp://mirrors.aliyun.com/alpine/v3.6/community" > /etc/apk/repositories
[INFO]
[INFO]  ---> Running in 55ca2b004a60
[INFO] Removing intermediate container 55ca2b004a60
[INFO]  ---> dda80e6fd283
[INFO] Step 8/10 : RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
[INFO]
[INFO]  ---> Running in 91ca53b26260
[INFO] fetch http://mirrors.aliyun.com/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
[INFO] fetch http://mirrors.aliyun.com/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
[INFO] ?[91mERROR: unsatisfiable constraints:
[INFO] ?[0m
[INFO]   glibc (missing):
[INFO]     required by: world[glibc><Q1JXdozHWl7OtAAxQ8rtz9LCO0YO4=]
[INFO]   glibc-bin (missing):
[INFO]     required by: world[glibc-bin><Q1TsbDJFLEqvG88jOersK2xnjWxC4=]
[ERROR] The command '/bin/sh -c apk add --update font-adobe-100dpi ttf-dejavu fontconfig' returned a non-zero code: 2
[WARNING] An attempt failed, will retry 1 more times
org.apache.maven.plugin.MojoExecutionException: Could not build image
        at com.spotify.plugin.dockerfile.BuildMojo.buildImage(BuildMojo.java:247)
        at com.spotify.plugin.dockerfile.BuildMojo.execute(BuildMojo.java:135)
        at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute(AbstractDockerMojo.java:265)
        at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute(AbstractDockerMojo.java:254)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)



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


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


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


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

1条回答
  • 2020-12-29 11:40

    看报错应该是安装字体的时候超时了,这个只能等待网络较好的时候构建,或者看下 这个帖子,有一个一劳永逸的办法:https://sns.bladex.cn/q-3090.html

    [INFO]  ---> Running in 91ca53b26260
    [INFO] fetch http://mirrors.aliyun.com/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
    [INFO] fetch http://mirrors.aliyun.com/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
    [INFO] ?[91mERROR: unsatisfiable constraints:
    [INFO] ?[0m
    [INFO]   glibc (missing):
    [INFO]     required by: world[glibc><Q1JXdozHWl7OtAAxQ8rtz9LCO0YO4=]
    [INFO]   glibc-bin (missing):
    [INFO]     required by: world[glibc-bin><Q1TsbDJFLEqvG88jOersK2xnjWxC4=]
    [ERROR] The command '/bin/sh -c apk add --update font-adobe-100dpi ttf-dejavu fontconfig' returned a non-zero code: 2
    [WARNING] An attempt failed, will retry 1 more times
    org.apache.maven.plugin.MojoExecutionException: Could not build image


    0 讨论(0)
提交回复