Skip to content

Commit b3dcd37

Browse files
committed
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).
1 parent 3a86223 commit b3dcd37

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docker/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ RUN apk update
44
RUN apk add --update bash
55
RUN apk add --update ncurses
66
RUN apk add --update nodejs
7+
RUN apk add --update git
78

89
ENV COURSIER_CACHE /root/.coursier
910
ENV SBT_OPTS -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled
@@ -73,4 +74,12 @@ RUN apk add --update graphviz
7374

7475
ENV LANG en_US.UTF-8
7576

76-
RUN apk add --update font-adobe-100dpi
77+
# JRE fails to load fonts if there are no standard fonts in the image; DejaVu is a good choice,
78+
# see https://github.com/docker-library/openjdk/issues/73#issuecomment-207816707
79+
RUN apk add --update ttf-dejavu
80+
RUN apk add --update font-adobe-100dpi
81+
82+
# These fonts are somewhat prettier
83+
RUN git clone --depth 1 --branch release https://github.com/adobe-fonts/source-code-pro.git /usr/share/fonts/source-code-pro && \
84+
rm -rf /usr/share/fonts/source-code-pro/.git && \
85+
fc-cache -f -v /usr/share/fonts/source-code-pro

0 commit comments

Comments
 (0)