[GH-ISSUE #348] [question] Objections against volume mapping /usr/share/fonts to docker container? #176

Closed
opened 2026-02-26 10:30:36 +03:00 by kerem · 5 comments
Owner

Originally created by @zilexa on GitHub (Mar 30, 2021).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/348

With OnlyOffice running in Docker (Compose), I would like it to support all fonts installed on the host system (Ubuntu 20.10).
I read here: https://github.com/ONLYOFFICE/DocumentServer/issues/7
you can copy the contents of /usr/share/fonts into the container and run the install command.
However, is there a reason why we should not simply add a bind mount in Docker Compose to map to the container fonts folder?

volumes:  
  usr/var/fonts:/usr/var/fonts

On Ubuntu, /usr/share/fonts/ contains a couple of subfolders. All fonts are in those subfolders.

Originally created by @zilexa on GitHub (Mar 30, 2021). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/348 With OnlyOffice running in Docker (Compose), I would like it to support all fonts installed on the host system (Ubuntu 20.10). I read here: https://github.com/ONLYOFFICE/DocumentServer/issues/7 you can copy the contents of /usr/share/fonts into the container and run the install command. However, is there a reason why we should not simply add a bind mount in Docker Compose to map to the container fonts folder? ``` volumes: usr/var/fonts:/usr/var/fonts ``` On Ubuntu, /usr/share/fonts/ contains a couple of subfolders. All fonts are in those subfolders.
kerem 2026-02-26 10:30:36 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@ShockwaveNN commented on GitHub (Mar 30, 2021):

Moved this question to separate repo

I think there is no reason not to do this, except I've usually create this mount:

-v /usr/share/fonts:/usr/share/fonts/custom

so fonts from host OS will not overwrite default docker image fonts, but just add as subfolder to docker fonts

<!-- gh-comment-id:810196546 --> @ShockwaveNN commented on GitHub (Mar 30, 2021): Moved this question to separate repo I think there is no reason not to do this, except I've usually create this mount: ``` -v /usr/share/fonts:/usr/share/fonts/custom ``` so fonts from host OS will not overwrite default docker image fonts, but just add as subfolder to docker fonts
Author
Owner

@zilexa commented on GitHub (Mar 30, 2021):

Thanks and I am sorry for asking, I just noticed this information is included in the Docker Installation documentation!
https://helpcenter.onlyoffice.com/installation/docs-community-docker-compose.aspx

Configuring ONLYOFFICE Docs
Using custom fonts

Mount the fonts folder from your local machine to the fonts folder within the onlyoffice-documentserver-data container. To do that:

open the docker-compose.yml file,
find the services -> onlyoffice-documentserver-data -> volumes section,
replace the - /usr/share/fonts string with the following one:

/your_local_fonts_folder:/usr/share/fonts

<!-- gh-comment-id:810198923 --> @zilexa commented on GitHub (Mar 30, 2021): Thanks and I am sorry for asking, I just noticed this information is included in the Docker Installation documentation! https://helpcenter.onlyoffice.com/installation/docs-community-docker-compose.aspx > Configuring ONLYOFFICE Docs >Using custom fonts >Mount the fonts folder from your local machine to the fonts folder within the onlyoffice-documentserver-data container. To do that: > open the docker-compose.yml file, > find the services -> onlyoffice-documentserver-data -> volumes section, > replace the - /usr/share/fonts string with the following one: > /your_local_fonts_folder:/usr/share/fonts
Author
Owner

@zilexa commented on GitHub (Mar 30, 2021):

Actually, I noticed with image onlyoffice/documentserver, the tools folder is missing in this path:

 /var/www/onlyoffice/documentserver/Tools/GenerateAllFonts.sh

Perhaps this is a bug?

<!-- gh-comment-id:810210938 --> @zilexa commented on GitHub (Mar 30, 2021): Actually, I noticed with image `onlyoffice/documentserver`, the tools folder is missing in this path: ``` /var/www/onlyoffice/documentserver/Tools/GenerateAllFonts.sh ``` Perhaps this is a bug?
Author
Owner

@ShockwaveNN commented on GitHub (Mar 30, 2021):

/var/www/onlyoffice/documentserver/Tools/GenerateAllFonts.sh

Current name is /usr/bin/documentserver-generate-allfonts.sh

GenerateAllFonts.sh is very old name of this script, where did you find this name?
By your link name is correct

<!-- gh-comment-id:810214201 --> @ShockwaveNN commented on GitHub (Mar 30, 2021): > /var/www/onlyoffice/documentserver/Tools/GenerateAllFonts.sh Current name is `/usr/bin/documentserver-generate-allfonts.sh` `GenerateAllFonts.sh` is very old name of this script, where did you find this name? By [your link](https://helpcenter.onlyoffice.com/installation/docs-community-docker-compose.aspx) name is correct
Author
Owner

@zilexa commented on GitHub (Mar 30, 2021):

The link does not tell you to run a script, only covers the mapping: https://helpcenter.onlyoffice.com/installation/docs-community-docker-compose.aspx

I got the old url from that very old issue: https://github.com/ONLYOFFICE/DocumentServer/issues/7

It did work btw with the path you provided, thanks a lot for your very quick reply!

<!-- gh-comment-id:810216283 --> @zilexa commented on GitHub (Mar 30, 2021): The link does not tell you to run a script, only covers the mapping: https://helpcenter.onlyoffice.com/installation/docs-community-docker-compose.aspx I got the old url from that very old issue: https://github.com/ONLYOFFICE/DocumentServer/issues/7 It did work btw with the path you provided, thanks a lot for your very quick reply!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#176
No description provided.