19

I would like to create a Docker image using Alpine Linux and LibreOffice to render PDF documents. The LibreOffice source documents are using Microsofts Times New Roman font.

How can I install Microsoft fonts using apk on Alpine Linux? Is there an equivalent packet to Ubuntus apt install ttf-mscorefonts-installer?

Update 1:

Meanwhile I have found a package called [msttcorefonts-installer][1] that seems to provide what I am looking for. When I try to install it on Alpine Linux 3.7 using apk add msttcorefonts-installer-3.6-r2 I get the following error:

ERROR: unsatisfiable constraints: msttcorefonts-installer-3.6-r2 (missing): required by: world[msttcorefonts-installer-3.6-r2] 
4
  • Did you check the Alpine packages? Commented Apr 17, 2018 at 6:58
  • I have updated my question providing the latest findings of my research. Commented Apr 17, 2018 at 7:29
  • You don't need the version number. apk --no-cache add msttcorefonts-installer works. Commented Apr 17, 2018 at 7:52
  • Your question saved my day... I was skeptic before installing AL. Commented Dec 30, 2021 at 2:56

1 Answer 1

56

As you found yourself the package is called msttcorefonts-installer in Alpine.

After installing that you get a warning:

  • With root permissions run "update-ms-fonts" and once completed
  • run "fc-cache -f" in order to update the font cache

Here is a working Dockerfile example:

FROM alpine:latest RUN apk --no-cache add msttcorefonts-installer fontconfig && \ update-ms-fonts && \ fc-cache -f 

The fontconfig package is required for fc-cache to be installed. I'm not sure if it's strictly necessary.

1
  • Upvoting, helped me to resolve issues with missing fonts when running a Java diagramming tool. Commented Apr 9, 2023 at 21:03

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.