[NTG-context] Installing fonts in a ConTeXt Docker (texfont tool missing?)

MF massifr at fastwebnet.it
Fri Apr 13 11:10:00 CEST 2018

> After setting ConTeXt root everything works fine and as expected.
> However, the texfont tool seems to be missing which means I cannot
> install new fonts in my container. This seems kind of odd to me since
> I thought texfont is available automatically after ConTeXt is
> installed. 
> I also tried Henri's Debian-based Dockerfile, but texfont seems to be
> missing there, too.
> Any ideas on this? Have I missed something? 

I don't know texfont, but i'm using ConTeXt inside a (Debian-based)
Docker container; i put the fonts directly into the image, like this
(this is an excerpt of my Dockerfile):

# copy fonts into the system fonts directories
COPY fonts/GaramondPremrPro*.otf /usr/share/fonts/opentype/
COPY fonts/MyriadPro*.otf        /usr/share/fonts/opentype/
COPY fonts/Quivira.otf           /usr/share/fonts/opentype/
COPY fonts/GFSNeohellenic*.otf   /usr/share/fonts/opentype/
COPY fonts/FiraSans*.otf         /usr/share/fonts/opentype/
COPY fonts/SILEOT*.ttf           /usr/share/fonts/truetype/

# a writable cache for ConTeXt,
# see http://wiki.contextgarden.net/Custom_Configuration
# (i don't know if this part is still needed)
RUN mkdir -p      /var/cache/context/texmf-cache
RUN chmod ugo+rwx /var/cache/context/texmf-cache
COPY texmf.cnf    /opt/context/texmf.cnf
COPY texmf.cnf    /opt/context/texmfcnf.lua
ENV TEXMFCACHE    /var/cache/context/texmf-cache
ENV TEXMF         /opt/context/tex/texmf-context
ENV TEXROOT       /opt/context/tex

The fonts you want to put in the image are in the "fonts" subdir of the
Dockerfile directory.
For "texmf.cnf" (if it's still needed), see the link in the ConTeXt

Once you build the image and run the container, you find the fonts
already installed. At the first run, ConTeXt will store them in its

You may write a Dockerfile of a ConTeXt image without fonts, then
another Dockerfile of an image based on the first one, where you add
the fonts you need for a particular job.

In case i had to add some fonts to a running container, i would "docker
cp" them inside it, in the system fonts dirs, and then "docker exec"
this command in the container:
mtxrun --script fonts --reload

Hope it helps,
best wishes,

More information about the ntg-context mailing list