dockerfile RUN set -xe && apk --no-cache add ttf-dejavu fontconfig macos下无法编译镜像

Blade 已结 2 2928
笨笨巫师
笨笨巫师 剑圣 2020-09-09 00:28

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

1. 

mvn clean package -Dmaven.test.skip=true dockerfile:build dockerfile:push

2. 

[INFO] Step 3/9 : RUN set -xe && apk --no-cache add ttf-dejavu fontconfig

[INFO] 

[INFO]  ---> Running in 8b5042791447

[INFO] + apk --no-cache add ttf-dejavu fontconfig

[INFO] 

[INFO] fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz

[INFO] fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz

[INFO] (1/11) Installing expat (2.2.9-r1)

[INFO] (2/11) Installing brotli-libs (1.0.7-r5)

[INFO] (3/11) Installing libbz2 (1.0.8-r1)

[INFO] (4/11) Installing libpng (1.6.37-r1)

[INFO] (5/11) Installing freetype (2.10.2-r0)

[INFO] (6/11) Installing libuuid (2.35.2-r0)

[INFO] (7/11) Installing fontconfig (2.13.1-r2)

[INFO] (8/11) Installing encodings (1.0.5-r0)

[INFO] (9/11) Installing libfontenc (1.1.4-r0)

[INFO] (10/11) Installing mkfontscale (1.2.1-r1)

[INFO] (11/11) Installing ttf-dejavu (2.37-r1)

[INFO] ERROR: Failed to create usr/share/fonts/ttf-dejavu/DejaVuSansCondensed-Oblique.ttf: No error information

[INFO] ERROR: ttf-dejavu-2.37-r1: BAD signature

[INFO] 

[INFO] Executing busybox-1.31.1-r16.trigger

[INFO] Executing fontconfig-2.13.1-r2.trigger

[INFO] Executing glibc-bin-2.31-r0.trigger

[INFO] /usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

[INFO] 

[INFO] 

[INFO] Executing mkfontscale-1.2.1-r1.trigger

[INFO] /usr/share/fonts/ttf-dejavu/: scandir: No such file or directory

[INFO] 

[INFO] /usr/share/fonts/ttf-dejavu/: 

[INFO] scandir

[INFO] : No such file or directory

[INFO] 

[INFO] 

[INFO] 1 error; 20 MiB in 27 packages

[ERROR] The command '/bin/sh -c set -xe && apk --no-cache add ttf-dejavu fontconfig' returned a non-zero code: 1

[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: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:956)

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

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

    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: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: The command '/bin/sh -c set -xe && apk --no-cache add ttf-dejavu fontconfig' returned a non-zero code: 1

    at com.spotify.plugin.dockerfile.LoggingProgressHandler.handleError (LoggingProgressHandler.java:105)

    at com.spotify.plugin.dockerfile.LoggingProgressHandler.progress (LoggingProgressHandler.java:63)

    at com.spotify.docker.client.DefaultDockerClient$BuildProgressHandler.progress (DefaultDockerClient.java:312)

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

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

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

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

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

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

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

3.


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


在macos环境下无法成功编译生成docker镜像文件。


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


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


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

2条回答
  •  admin
    admin (最佳回答者)
    2020-09-09 15:22

    如果没有改过dockerfile的话一般是网络影响导致

    可以看到,大家给出的解决方案都是这一行命令

    image.png

    0 讨论(1)
  • 2020-09-21 21:03
    RUN set -xe \
        && echo -e 'https://mirrors.aliyun.com/alpine/v3.6/main/\nhttps://mirrors.aliyun.com/alpine/v3.6/community/' > /etc/apk/repositories \
        && apk update \
        && apk upgrade \
        && apk --no-cache add ttf-dejavu fontconfig


    0 讨论(0)
提交回复