i’m trying to run ubuntu on my mac via docker. The goal is to create a docker image with my dotfiles installed, so that i can run the image and get a clean interactive ubuntu terminal with preinstalled dotfiles (proper zsh, tmux, neovim etc). But right now i’m struggeling with fonts. My tmux statusline and my zsh prompt uses some special fonts from the
MesloLGS NF.ttf. Usually i just install this font manually and tell my terminal emulator (alacritty, kitty or iterm) to use it by adjusting it’s config. But in docker it’s different: the terminal emulator is not there since bash or zsh are executed directly by docker (e.g. after starting a docker container with:
docker container run -it my_image). So who is in charge setting the fonts for the terminal?
I configured my
Dockerfile in a way, that it downloads all my cusom fonts, moves them to the
~/.fonts directory for system-wide and per user installation. Then i run
fc-cache -f -v to update my font cache. I can check with
fc-list that all my fonts are installed correctly. But when i run tmux, the statusbar looks terrible since the wrong fontset is used. Tmux for instance has no ability to use a different font than the parent terminal. But as of my understanding, there is no parent terminal. It’s just docker that spawns that shell process directly. Any ideas how to tell docker to use custom fonts?
NOTE: I know i can get GUI applications running inside docker with this [magic](: Running GUI’s with Docker on Mac OS X | by Nils De Moor | Containerizers) and then install a graphical terminal emulator like kitty but this seems like an overkill to me