admin管理员组

文章数量:1122846

I'm trying to run alpine inside docker container with GUI. So I'm using the following command

docker run -it --env="DISPLAY" --net=host --name ostestalpine alpine

Inside the container, I'm installing firefox and other necessary tools. And when I'm launching firefox it's launching but, all the texts are being rendered is some weird way, most probably with unicode representation only. Please check this image:

How can I fix this?

I'm trying to run alpine inside docker container with GUI. So I'm using the following command

docker run -it --env="DISPLAY" --net=host --name ostestalpine alpine

Inside the container, I'm installing firefox and other necessary tools. And when I'm launching firefox it's launching but, all the texts are being rendered is some weird way, most probably with unicode representation only. Please check this image:

How can I fix this?

Share Improve this question asked Nov 21, 2024 at 20:16 Maifee Ul AsadMaifee Ul Asad 4,6079 gold badges49 silver badges115 bronze badges 1
  • This doesn't seem like it's programming-related; if it is, can you edit the question to include whatever source code you've written? Also see Can you run GUI applications in a Linux Docker container? If your problem is font rendering, then this may be using the font files in the container and not fonts that exist on the host. Similar complexities exist up and down the stack, and I'd just run the browser and other desktop apps directly on the host system. – David Maze Commented Nov 21, 2024 at 21:12
Add a comment  | 

1 Answer 1

Reset to default 0

Resolved it by installing fonts:

apk --update --upgrade --no-cache add fontconfig ttf-freefont font-noto term
inus-font \
    && fc-cache -f \
    && fc-list | sort

If you want to add custom fonts, try adding them under /usr/share/fonts/Additional

references

  • https://github.com/orzih/mkdocs-with-pdf/blob/c97272aa92440789de2d93a6e78ae42b9c441eef/docker/mkdocs-with-pdf/alpine/Dockerfile#L25-L29
  • https://github.com/orzih/mkdocs-with-pdf/issues/50#issuecomment-767140386

本文标签: dockerHow can I properly render gui in my dockerized alpine containerStack Overflow