New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in Alpine JRE 8 Font #73

Open
jasonmader opened this Issue Apr 9, 2016 · 29 comments

Comments

Projects
None yet
@jasonmader
Copy link

jasonmader commented Apr 9, 2016

JVM Version: 1.8.0_77-internal-alpine-r0-b03

INFO [CaptchaImpl] Initializing com.liferay.portal.captcha.simplecaptcha.SimpleCaptchaImpl
Fontconfig warning: ignoring C.UTF-8: not a valid language tag
ERROR [CaptchaPortletAction] null
java.lang.NullPointerException
    at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
    at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
    at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
    at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
    at sun.font.SunFontManager$2.run(SunFontManager.java:431)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.SunFontManager.<init>(SunFontManager.java:376)
    at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
    at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
    at java.awt.Font.getFont2D(Font.java:491)
    at java.awt.Font.access$000(Font.java:224)
    at java.awt.Font$FontAccessImpl.getFont2D(Font.java:228)
    at sun.font.FontUtilities.getFont2D(FontUtilities.java:180)
    at sun.font.StandardGlyphVector.initFontData(StandardGlyphVector.java:1126)
    at sun.font.StandardGlyphVector.init(StandardGlyphVector.java:1115)
    at sun.font.StandardGlyphVector.<init>(StandardGlyphVector.java:167)
    at java.awt.Font.createGlyphVector(Font.java:2545)
    at nl.captcha.text.renderer.DefaultWordRenderer.render(Unknown Source)
    at nl.captcha.Captcha$Builder.addText(Unknown Source)
    at com.liferay.portal.captcha.simplecaptcha.SimpleCaptchaImpl.getSimpleCaptcha(SimpleCaptchaImpl.java:243)
    at com.liferay.portal.captcha.simplecaptcha.SimpleCaptchaImpl.serveImage(SimpleCaptchaImpl.java:159)
    at com.liferay.portal.captcha.CaptchaImpl.serveImage(CaptchaImpl.java:100)
    at com.liferay.portal.kernel.captcha.CaptchaUtil.serveImage(CaptchaUtil.java:78)
    at com.liferay.portal.captcha.CaptchaPortletAction.serveResource(CaptchaPortletAction.java:42)
@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

This is probably the same issue as #46, which was fixed in #48.

It looks like the relevant package may be called fontconfig in Alpine.

@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

As in the Debian case, I think the best fix is actually to add a dependency to the openjdk8-jre package in Alpine since the JDK doesn't handle the absence of fontconfig gracefully.

@jasonmader

This comment has been minimized.

Copy link
Author

jasonmader commented Apr 9, 2016

Iʼm not sure. I added the fontconfig package as a test, you can see the message,
Fontconfig warning: ignoring C.UTF-8: not a valid language tag

@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

Right. Sorry I missed that part in your original message.

The weird thing is that that error message comes from fontconfig, but it seems that java:alpine doesn't have fontconfig installed. Perhaps fontconfig is statically linked into the JRE on Alpine?

I took a look at the source code for OpenJDK 8 and traced back that NPE (the starting point is here). It looks like the proximate issue is that there is no fontconfig.properties or fontconfig.bcf file (or any OS name-qualified variant), so readFontConfigFile(File) never calls loadProperties(InputStream) or loadBinary(InputStream) and the head variable is never initialized, resulting in a NullPointerException.

I'm not sure the apparent warning from fontconfig matters all that much, but that happens here. I'm not well-versed in C code, so that string parsing code makes my eyes glaze over and I'm not sure why it doesn't like C.UTF-8, but it seems like the "-" in "UTF-8" may be throwing it off.

As an additional data point, when I call Charset.defaultCharset().name() in a java:alpine container, which is what FontConfiguration uses to determine the current encoding, it returns "UTF-8". It returns the same value when running under LANG=C.UTF8 or LANG=C.utf8.

I didn't dig into Debian's packaging of libfontconfig1 to see if they're patching that part of fontconfig to avoid the warning.

@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

It may be worth pulling fontconfig.properties from the Debian-based java:8 image and seeing what happens.

@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

Thinking about it some more, I think the Fontconfig warning happens because “C” is only one character long and the code expects 2-3 characters. There is code earlier in the function that deals with plain “C”, but the codeset qualifier causes that code to be skipped.

Still not sure how Debian is different here (assuming it doesn't also show that warning).

@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

I looked through the fontconfig code a bit more and it looks like that call to FcNormalizeLang comes from FcStrSetAddLangs, which comes from FcGetDefaultLangs. In the case where that warning is generated, the code will fall back to adding "en" as a default language: https://cgit.freedesktop.org/fontconfig/tree/src/fcdefault.c#n70

@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

I see now that the Debian java:8-jre image doesn't actually have a fontconfig.properties file. It looks like that code path only gets used if the JRE can't get any font information from libfontconfig. Here's what I see when I run a variant of the code in https://gist.github.com/md5/7fb07efafee3802da457 using the -Dsun.java2d.debugfonts=true flag on Alpine:

Headless: true
Apr 09, 2016 4:28:05 PM sun.awt.X11FontManager registerFontDir
INFO: ParseFontDir /usr/lib/jvm/java-1.8-openjdk/jre/lib/fonts
Apr 09, 2016 4:28:05 PM sun.awt.FontConfiguration <init>
INFO: Creating standard Font Configuration
Apr 09, 2016 4:28:05 PM sun.awt.FontConfiguration <init>
INFO: Creating standard Font Configuration
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for sans:regular:roman
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for sans:bold:roman
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for sans:regular:italic
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for sans:bold:italic
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for serif:regular:roman
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for serif:bold:roman
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for serif:regular:italic
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for serif:bold:italic
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for monospace:regular:roman
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for monospace:bold:roman
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for monospace:regular:italic
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for monospace:bold:italic
Apr 09, 2016 4:28:05 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no fonts at all.
Apr 09, 2016 4:28:05 PM sun.font.FcFontConfiguration warning
WARNING: Failed to get info from libfontconfig
Apr 09, 2016 4:28:05 PM sun.font.FcFontConfiguration warning
WARNING: Failed to get info from libfontconfig
Exception in thread "main" java.lang.NullPointerException
    at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
    at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
    at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
    at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
    at sun.font.SunFontManager$2.run(SunFontManager.java:431)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.SunFontManager.<init>(SunFontManager.java:376)
    at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
    at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
    at java.awt.Font.<init>(Font.java:614)
    at java.awt.Font.createFont(Font.java:1056)
    at Test.main(Test.java:8)

And here's what I see on Debian:

+ rm -f Test.class
+ docker pull java:8-jdk
+ docker run --rm -v /Users/dillm022/Code/gists/java-8-jre-font-test:/work -w /work java:8-jdk javac Test.java
+ docker pull java:8-jre
+ docker run --rm -v /Users/dillm022/Code/gists/java-8-jre-font-test:/work -w /work java:8-jre java -Dsun.java2d.debugfonts=true -cp . Test
Headless: true
Apr 09, 2016 4:28:31 PM sun.awt.X11FontManager registerFontDir
INFO: ParseFontDir /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/fonts
Apr 09, 2016 4:28:31 PM sun.awt.FontConfiguration <init>
INFO: Creating standard Font Configuration
Apr 09, 2016 4:28:31 PM sun.awt.FontConfiguration <init>
INFO: Creating standard Font Configuration
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Time spent accessing fontconfig=35ms.
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font sans:regular:roman maps to family DejaVu Sans in file /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Book Fullname=DejaVu Serif File=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font sans:bold:roman maps to family DejaVu Sans in file /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Bold Fullname=DejaVu Sans Mono Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font sans:regular:italic maps to family DejaVu Sans in file /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Book Fullname=DejaVu Serif File=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font sans:bold:italic maps to family DejaVu Sans in file /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Bold Fullname=DejaVu Sans Mono Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font serif:regular:roman maps to family DejaVu Serif in file /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Book Fullname=DejaVu Serif File=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font serif:bold:roman maps to family DejaVu Serif in file /usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Book Fullname=DejaVu Serif File=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Bold Fullname=DejaVu Sans Mono Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font serif:regular:italic maps to family DejaVu Serif in file /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Book Fullname=DejaVu Serif File=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font serif:bold:italic maps to family DejaVu Serif in file /usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Book Fullname=DejaVu Serif File=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Bold Fullname=DejaVu Sans Mono Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font monospace:regular:roman maps to family DejaVu Sans Mono in file /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Book Fullname=DejaVu Serif File=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font monospace:bold:roman maps to family DejaVu Sans Mono in file /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Bold Fullname=DejaVu Sans Mono Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font monospace:regular:italic maps to family DejaVu Sans Mono in file /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Book Fullname=DejaVu Serif File=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font monospace:bold:italic maps to family DejaVu Sans Mono in file /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Bold Fullname=DejaVu Sans Mono Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Mono Style=Book Fullname=DejaVu Sans Mono File=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Bold Fullname=DejaVu Sans Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Serif Style=Bold Fullname=DejaVu Serif Bold File=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
Apr 09, 2016 4:28:32 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=DejaVu Sans Style=Book Fullname=DejaVu Sans File=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager$2 run
INFO: JRE font directory: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/fonts
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager$2 run
INFO: Extra font path: null
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager$2 run
INFO: Debug font path: null
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: Initialising composite fonts
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Serif, Font Serif.plain rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Serif with style 0 to family Serif
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Serif.plain
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Serif, Font Serif.bold rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Serif with style 1 to family Serif
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Serif.bold
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Serif, Font Serif.italic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Serif with style 2 to family Serif
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Serif.italic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Serif, Font Serif.bolditalic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Serif with style 3 to family Serif
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Serif.bolditalic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family SansSerif, Font SansSerif.plain rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add SansSerif with style 0 to family SansSerif
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered SansSerif.plain
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family SansSerif, Font SansSerif.bold rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add SansSerif with style 1 to family SansSerif
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered SansSerif.bold
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family SansSerif, Font SansSerif.italic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add SansSerif with style 2 to family SansSerif
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered SansSerif.italic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family SansSerif, Font SansSerif.bolditalic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add SansSerif with style 3 to family SansSerif
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered SansSerif.bolditalic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Monospaced, Font Monospaced.plain rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Monospaced with style 0 to family Monospaced
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Monospaced.plain
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Monospaced, Font Monospaced.bold rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Monospaced with style 1 to family Monospaced
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Monospaced.bold
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Monospaced, Font Monospaced.italic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Monospaced with style 2 to family Monospaced
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Monospaced.italic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Monospaced, Font Monospaced.bolditalic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Monospaced with style 3 to family Monospaced
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Monospaced.bolditalic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Dialog, Font Dialog.plain rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Dialog with style 0 to family Dialog
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Dialog.plain
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Dialog, Font Dialog.bold rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Dialog with style 1 to family Dialog
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Dialog.bold
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Dialog, Font Dialog.italic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Dialog with style 2 to family Dialog
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Dialog.italic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family Dialog, Font Dialog.bolditalic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add Dialog with style 3 to family Dialog
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered Dialog.bolditalic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family DialogInput, Font DialogInput.plain rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add DialogInput with style 0 to family DialogInput
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered DialogInput.plain
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family DialogInput, Font DialogInput.bold rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add DialogInput with style 1 to family DialogInput
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered DialogInput.bold
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family DialogInput, Font DialogInput.italic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add DialogInput with style 2 to family DialogInput
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered DialogInput.italic
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager addCompositeToFontList
INFO: Add to Family DialogInput, Font DialogInput.bolditalic rank=2
Apr 09, 2016 4:28:32 PM sun.font.FontFamily setFont
INFO: Request to add DialogInput with style 3 to family DialogInput
Apr 09, 2016 4:28:32 PM sun.font.SunFontManager initCompositeFonts
INFO: registered DialogInput.bolditalic
Apr 09, 2016 4:28:32 PM sun.font.TrueTypeFont open
INFO: open TTF: test.ttf
@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

It seems like the underlying issue is that fontconfig can't find any fonts in the java:8-jre-alpine image because there are no fonts:

$ docker run --rm java:8-jre-alpine find / -name '*.ttf'

The Debian-based image has just enough fonts to support the default JDK fonts, it seems:

$ docker run --rm java:8-jre find / -name '*.ttf'
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf

These fonts come from the fonts-dejavu-core package, which is a transitive dependency of libfontconfig1 on Debian.

@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 9, 2016

@jasonmader Try installing the ttf-dejavu package and see what happens. It seems to fix things for me. although it does add 124 MiB of packages to the image

Update: There are 124 MiB of packages in the image total after adding ttf-dejavu. Looks like it actually adds about 20 MiB to the image:

$ docker images | grep jre-alpine
java                      8-jre-alpine-with-fonts   82a7a914a102        4 seconds ago       127.7 MB
java                      8-jre-alpine              fa6dc16ed7ae        4 days ago          108.3 MB
@jasonmader

This comment has been minimized.

Copy link
Author

jasonmader commented Apr 9, 2016

Thanks, that works.

@jasonmader

This comment has been minimized.

Copy link
Author

jasonmader commented Apr 10, 2016

Also, I added ENV LC_CTYPE en_US.UTF-8 to avoid the Fontconfig warning in the log.

@md5

This comment has been minimized.

Copy link
Contributor

md5 commented Apr 11, 2016

@jasonmader I don't think that the base alpine image actually has an en_US locale exactly (see gliderlabs/docker-alpine#144), but I can't say for certain that setting that will have any ill repercussions. If you want to set it for just fontconfig, my read of the source discovered that FC_LANG takes precedence over LC_CTYPE (and LANG).

@jasonmader

This comment has been minimized.

Copy link
Author

jasonmader commented Apr 18, 2016

This doesn’t appear to be a locale setting for FC_LANG just the font language, as can be checked with fc-list :lang=en-US so ENV FC_LANG en-US seems to be the appropriate fix for this.

@hossman

This comment has been minimized.

Copy link

hossman commented Mar 6, 2017

FYI: Same problem seems to afflict openjdk:9-jdk (9-b158)

workaround as noted in #48 ...

apt-get -y --no-install-recommends install libfontconfig1

hossman added a commit to hossman/solr-jdk9-jenkins-on-docker that referenced this issue Mar 6, 2017

stanch added a commit to stanch/scastie that referenced this issue Apr 27, 2017

Improve font configuration
Due to some standard fonts missing, JRE was failing to load the fonts.
DejaVu fonts are added to mitigate this, as per:

  docker-library/openjdk#73 (comment)

Additionally, the Source Code Pro fonts are added. They look somewhat better
and are used by [reftree](https://github.com/stanch/reftree).

stanch added a commit to stanch/scastie that referenced this issue Apr 27, 2017

Improve font configuration
Due to some standard fonts missing in the SBT runner image,
the JVM was failing to load the fonts when running any font-related code.
DejaVu fonts are added to mitigate this, as per:

  docker-library/openjdk#73 (comment)

Additionally, the Source Code Pro fonts are added. They look somewhat better
and are used by [reftree](https://github.com/stanch/reftree).

MasseGuillaume added a commit to scalacenter/scastie that referenced this issue Apr 27, 2017

Improve font configuration
Due to some standard fonts missing in the SBT runner image,
the JVM was failing to load the fonts when running any font-related code.
DejaVu fonts are added to mitigate this, as per:

  docker-library/openjdk#73 (comment)

Additionally, the Source Code Pro fonts are added. They look somewhat better
and are used by [reftree](https://github.com/stanch/reftree).

siren added a commit to HSLdevcom/OpenTripPlanner that referenced this issue May 16, 2017

@siren siren referenced this issue May 16, 2017

Merged

fix debug tiles #144

agronholm added a commit to agronholm/docker-atlassian-confluence that referenced this issue Feb 7, 2018

Added the ttf-dejavu package
Without this, some Confluence macros do not work (repro'd for the Page Tree macro). The POST request for returns a 500 error, caused by a NullPointerException in Java which in turn is caused by the lack of fonts and/or libfontconfig. Relevant issue here: docker-library/openjdk#73

int128 added a commit to int128/gitbucket-docker that referenced this issue Apr 3, 2018

@wglambert wglambert added the Issue label Apr 24, 2018

@snimavat

This comment has been minimized.

Copy link

snimavat commented May 3, 2018

installing ttf-dejavu packge fixed it.

basejump added a commit to yakworks/dock9 that referenced this issue May 7, 2018

Merge pull request #1 from yakworks/fontconfig-fix
Add fontconfig and ttf-dejavu package to fix docker-library/openjdk#73
@arunvc

This comment has been minimized.

Copy link

arunvc commented May 15, 2018

Same issue in jre-10 while generating excel reports, ubuntu 16.04
installing fontconfig ttf-dejavu solved this issues

@meawoppl

This comment has been minimized.

Copy link

meawoppl commented Jun 7, 2018

Bumped into this today. Hard to debug!

@tianon

This comment has been minimized.

Copy link
Member

tianon commented Jul 23, 2018

#73 (comment)

Is [this] still reproducible? (anyone have a trivial reproducer handy?)

Anyone confirmed whether this is an upstream bug, a Debian/Alpine bug, or a Docker image bug?

1tchy added a commit to 1tchy/opentripplanner-docker-ch that referenced this issue Aug 2, 2018

@cesartl

This comment has been minimized.

Copy link

cesartl commented Sep 17, 2018

As of today we are still getting this error with Jdk 10 on alpine. It works fine on debian when we install fontconfig but it doesn't work on alpine. When using debug we also get

Fontconfig returned no fonts at all.

HerrmannHinz added a commit to mercedesbenzio/docker-maven that referenced this issue Sep 21, 2018

@ST-DDT

This comment has been minimized.

Copy link

ST-DDT commented Oct 10, 2018

AFAICT 8-jre-alpine still has that issue. 8-jre-slim works as expected.
Can this only be fixed by installing a new package in the container?

@debuglevel

This comment has been minimized.

Copy link

debuglevel commented Dec 28, 2018

Quite hard to debug and find the source of this error. For me it even crashed with diverse errors (which I paste, so somebody might find it on Google):

java.lang.NoClassDefFoundError: Could not initialize class org.apache.batik.bridge.DefaultFontFamilyResolver
	at org.apache.batik.bridge.UserAgentAdapter.getFontFamilyResolver(UserAgentAdapter.java:465)
	at org.apache.batik.bridge.BridgeContext.getFontFamilyResolver(BridgeContext.java:284)
	at org.apache.batik.bridge.SVGTextElementBridge.getFontList(SVGTextElementBridge.java:1518)
	at org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(SVGTextElementBridge.java:1597)

or

java.lang.ExceptionInInitializerError
	at org.apache.batik.bridge.UserAgentAdapter.getFontFamilyResolver(UserAgentAdapter.java:465)
	at org.apache.batik.bridge.BridgeContext.getFontFamilyResolver(BridgeContext.java:284)
	at org.apache.batik.bridge.SVGTextElementBridge.getFontList(SVGTextElementBridge.java:1518)

(I think there had also been a NullPointerException, but I could not find it anymore.)

Adding RUN apk add --no-cache ttf-dejavu to the Dockerfile fixes the issue.

I wonder if this could also be an upstream issue for the OpenJDK developers, as throwing those Exceptions is really not helpful to point out that there are fonts missing.

@tbrouhier

This comment has been minimized.

Copy link

tbrouhier commented Jan 3, 2019

Ran into this issue. Thanks to this issue for providing detailed information.
The workaround adding the RUN apk add --no-cache ttf-dejavu does indeed work.

Seeing md5's comment on how it adds 20 MB to the image, I suppose there's no way that would be the solution to provide support by default. Is there a lead about a sustainable fix?

@ST-DDT

This comment has been minimized.

Copy link

ST-DDT commented Jan 3, 2019

Maybe you could provide a "_with_fonts" image along with the current images?

@debuglevel

This comment has been minimized.

Copy link

debuglevel commented Jan 4, 2019

I don't think a _with_fonts image would improve much, as you still don't know that you need this image (as there is no meaningful exception thrown). And if you actually know that you need this image, you can apply the appropriate RUN command in your Dockerfile.

@jnunderwood

This comment has been minimized.

Copy link

jnunderwood commented Jan 9, 2019

Shouldn't the alpine version of openjdk behave the same way as the other versions? I realize that adding ttf-dejavu to the image would mean increasing its size by an extra 20MiB. Fixing the problem is easy enough (if you happen to find this thread), but the big issue for many people, it seems, is tracking down the source of the problem when you encounter it.

@debuglevel

This comment has been minimized.

Copy link

debuglevel commented Jan 10, 2019

full ack @jnunderwood
Another idea might therefore be to add some "notable problems" in the docker hub description at https://hub.docker.com/_/openjdk/ which points out, that the alpine image is missing fonts, which might break the functionality of OpenJDK (may be there are some other issues which should be described).

@J0WI

This comment has been minimized.

Copy link
Contributor

J0WI commented Jan 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment