md2pdf icon indicating copy to clipboard operation
md2pdf copied to clipboard

Add fonts to docker container

Open jmaupetit opened this issue 10 years ago • 5 comments

We need to document custom font installation in a docker container.

jmaupetit avatar Nov 06 '14 10:11 jmaupetit

Maybe adding something like the following to the Dockerfile would be sufficient:

# Copy local fonts in an indexable place
COPY /srv/fonts ~/.fonts

# Update font cache
RUN fc-cache -f -v

Any font file under the local fonts directory will then be indexed and fully available.

@krichprollsch @lunika WDYT?

jmaupetit avatar Dec 01 '15 13:12 jmaupetit

I'm not a font specialist, but you could use a volume instead to load the fonts dynamically into the dir/usr/share/fonts/ of the container. But that's mean you should also run fc-cache -f -v at runtime :/

krichprollsch avatar Dec 01 '15 15:12 krichprollsch

Or maybe using a volume to share your "compiled" fonts from your computer to the container to avoid the fc-cache at runtime ? I don't know if it's possible...

krichprollsch avatar Dec 01 '15 15:12 krichprollsch

After a brief discussion with @themouette, we think it's not that bad to rebuild your container when you need to use a new font. @krichprollsch do you agree?

jmaupetit avatar Dec 03 '15 12:12 jmaupetit

:+1:

krichprollsch avatar Dec 03 '15 15:12 krichprollsch