Author: Peppermint Tail
Link: https://blog.hoshiroko.com/archives/8fa981731bb3
FireFox is an open-source web browser, let's install it.
First, we need a Docker environment. To install the Docker environment, please refer to Install Docker on Linux.
Of course, because we are VNC-ing to the server to use the server's web browser, if you are using a foreign server, you might even... Ahem! Stop!
1. Install using Docker CE#
docker run -d \
--name FireFox \
--network host \
-e TZ=Asia/Shanghai \
-e VNC_PASSWORD=wg122100 \
-e DISPLAY_WIDTH=1920 \
-e DISPLAY_HEIGHT=1080 \
-e WEB_LISTENING_PORT=12580 \
-v /root/docker/firefox:/config:rw \
jlesage/firefox
VNC_PASSWORD=
is the VNC connection password, for security reasons, please be sure to change it
WEB_LISTENING_PORT=
is the Web VNC port number, you can customize it
More environment variables: https://github.com/jlesage/docker-firefox?tab=readme-ov-file#environment-variables
Now, open a browser and enter {server IP}:15800
to access (don't forget to open the firewall).
2. Chinese garbled characters issue#
Downloading Chinese fonts can solve this issue. You can find Chinese fonts online or use the Source Han Sans font provided on this site.
Then, import the font into the specified directory inside the container (re-importing is needed when rebuilding the container).
docker cp SourceHanSansSC-Normal.otf FireFox:/usr/share/fonts
If using a different font, simply replace SourceHanSansSC-Normal.otf
.