wsl安装edge浏览器并设置中文支持
deb包下载路径:https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_139.0.3405.125-1_amd64.deb?brand=M102
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
sudo apt --fix-broken install || apt install -y dpkg -i microsoft-edge-stable_139.0.3405.125-1_amd64.deb
microsoft-edge
sudo apt install fonts-noto-cjk fonts-noto-cjk-extra sudo apt install language-pack-zh-hans
edge://settings/languages
fc-list :lang=zh
fc-list :lang=zh 如果输出包含 Noto Sans CJK 或 Microsoft YaHei,说明字体已生效。
microsoft-edge
|
构建docker镜像
已构建镜像: registry.cn-hangzhou.aliyuncs.com/zznn/mycentos:edge
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| FROM registry.cn-hangzhou.aliyuncs.com/zznn/ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \ tzdata \ wget \ xdg-utils \ libx11-xcb1 \ libxtst6 \ libnss3 \ libasound2 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libgtk-3-0 \ fonts-liberation \ libdrm2 \ libgbm1 \ libxcb-dri3-0 \ libxshmfence1 \ && ln -fs /usr/share/zoneinfo/UTC /etc/localtime \ && dpkg-reconfigure --frontend noninteractive tzdata \ && rm -rf /var/lib/apt/lists/*
COPY sources.list /etc/apt/sources.list RUN apt update RUN apt install fonts-noto-cjk fonts-noto-cjk-extra
COPY ./microsoft-edge-stable_139.0.3405.125-1_amd64.deb /opt/
RUN apt install -f -y && \ apt --fix-broken install -y && \ apt install -y /opt/microsoft-edge-stable_139.0.3405.125-1_amd64.deb && \ rm -rf /var/lib/apt/lists/* /opt/*.deb
RUN groupadd -r appuser && \ useradd -r -g appuser -d /home/appuser -s /bin/bash appuser && \ mkdir -p /home/appuser && \ chown -R appuser:appuser /home/appuser
WORKDIR /app RUN chown -R appuser:appuser /app
USER appuser
CMD ["microsoft-edge", "--no-sandbox", "--disable-dev-shm-usage", "--disable-crash-reporter"]
|
构建
1
| docker build -f Dockerfile -t zznn/edge .
|
运行
1 2 3
| xhost +local: docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix zznn/edge:latest
|
现成的镜像运行
1
| docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.cn-hangzhou.aliyuncs.com/zznn/mycentos:edge
|
快捷方式(保存为.bat后缀即可windows桌面使用)
docker版本桌面快捷方式
1 2 3 4 5 6
| @echo off if "%1"=="h" goto begin start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit :begin
wsl -d Ubuntu-20.04 -- bash -c "docker run --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.cn-hangzhou.aliyuncs.com/zznn/mycentos:edge"
|
二进制方式快捷方式bat
1 2 3 4 5 6
| @echo off if "%1"=="h" goto begin start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit :begin
wsl -d Ubuntu-20.04 -- bash -c "microsoft-edge"
|