给一个 chromium 的(算是 Chrome 的亲兄弟?),支持 VNC 密码。参考
https://github.com/accetto/debian-vnc-xfce-g3```yaml
version: '2'
services:
chromium:
image: "accetto/debian-vnc-xfce-chromium-g3:latest"
ports:
- "6901:6901"
shm_size: 512m
environment:
- VNC_PORT=5091
- VNC_PW=headless
- VNC_RESOLUTION=1360x768
```
- 中文字体环境问题?
参考如下 Dockerfile ,安装中文字体就行。
```Dockerfile
FROM accetto/debian-vnc-xfce-chromium-g3:latest
USER root
RUN sed -i "s@http://
deb.debian.org@http://
mirrors.aliyun.com@g" /etc/apt/sources.list && \
rm -Rf /var/lib/apt/lists/* && \
apt-get update && \
apt-get install -y locales fonts-wqy-zenhei && \
localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
# ENV LANG zh_CN.UTF-8
USER 1000
```
- 启动时,附带 chromium 参数?参考如下的 `chromium.desktop` 文件,可以设置使用代理,然后将通过数据卷将 `chromium.desktop` 进行挂载。
> `./chromium.desktop:/home/headless/Desktop/chromium.desktop`
```desktop
[Desktop Entry]
Version=1.0
Name=Chromium Web Browser
Name[zh_CN]=Chromium 网页浏览器
Name[zh_HK]=Chromium 網頁瀏覽器
Name[zh_TW]=Chromium 網頁瀏覽器
GenericName=Web Browser
GenericName[zh_CN]=网页浏览器
GenericName[zh_HK]=網頁瀏覽器
GenericName[zh_TW]=網頁瀏覽器
Comment=Access the Internet
Comment[zh_CN]=访问互联网
Comment[zh_HK]=連線到網際網路
Comment[zh_TW]=連線到網際網路
Exec=chromium %U --no-sandbox --proxy-server=http://YOUR_PROXY_HOST:YOUR_PROXY_PORT
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=chromium
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Actions=NewWindow;Incognito;TempProfile;
X-AppInstall-Package=chromium
Path=
[Desktop Action NewWindow]
Name=Open a New Window
Name[zh_CN]=打开新窗口
Name[zh_TW]=開啟新視窗
Exec=chromium --no-sandbox --proxy-server=http://YOUR_PROXY_HOST:YOUR_PROXY_PORT
[Desktop Action Incognito]
Name=Open a New Window in incognito mode
Name[zh_CN]=以隐身模式打开新窗口
Name[zh_TW]=以匿名模式開啟新視窗
Exec=chromium --incognito --no-sandbox
[Desktop Action TempProfile]
Name=Open a New Window with a temporary profile
Name[zh_CN]=以临时配置文件打开新窗口
Name[zh_TW]=以暫時性個人身分開啟新視窗
Exec=chromium --temp-profile --no-sandbox --proxy-server=http://YOUR_PROXY_HOST:YOUR_PROXY_PORT
```