jlesage/firefox 是一个web版firefox浏览器,可以使用docker中运行web版浏览器,很是方便。
运行命令
docker run -d \
    --name=firefox \
    -p 5800:5800 \
    -v /docker/appdata/firefox:/config:rw \
    jlesage/firefox中文乱码异常

查阅GitHub文档发现有一个环境变量可以解决这个问题;
ENABLE_CJK_FONT:When set to 1, open-source computer font WenQuanYi Zen Hei is installed. This font contains a large range of Chinese/Japanese/Korean characters. 
默认是0,这个意思是 当设置为1时,将安装开源计算机字体WenQuanYi Zen Hei。此字体包含大量中文/日文/韩文字符。
能解决这个异常问题;
安全问题
如果暴露在外网后,容易遭受攻击,所以该容器又提供了一个密码设置的环境变量VNC_PASSWORD
docker run -d \
    --name=firefox \
    -p 5800:5800 \
    -v /docker/appdata/firefox:/config:rw \
    -e VNC_PASSWORD=123456 \
    jlesage/firefoxNginx 反代配置
参考文档,配置如下:
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}
upstream docker-firefox {
    # If the reverse proxy server is not running on the same machine as the
    # Docker container, use the IP of the Docker host here.
    # Make sure to adjust the port according to how port 5800 of the
    # container has been mapped on the host.
    server 127.0.0.1:5800;
}
server {
    [...]
    server_name firefox.domain.tld;
    location / {
            proxy_pass http://docker-firefox;
    }
    location /websockify {
        proxy_pass http://docker-firefox;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_read_timeout 86400;
    }
}二级目录
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}
upstream docker-firefox {
    # If the reverse proxy server is not running on the same machine as the
    # Docker container, use the IP of the Docker host here.
    # Make sure to adjust the port according to how port 5800 of the
    # container has been mapped on the host.
    server 127.0.0.1:5800;
}
server {
    [...]
    location = /firefox {return 301 $scheme://$http_host/firefox/;}
    location /firefox/ {
        proxy_pass http://docker-firefox/;
        # Uncomment the following line if your Nginx server runs on a port that
        # differs from the one seen by external clients.
        #port_in_redirect off;
        location /firefox/websockify {
            proxy_pass http://docker-firefox/websockify/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            proxy_read_timeout 86400;
        }
    }
} 
         
           
           
           
          
之前为了做店铺ip隔离,买了好多云主机,如果用这个docker浏览器是不是成本更低
不行,如果开多个docker来跑浏览器,第一首先ip都是一个出口,满足不了你第一个需求,第二,这个docker浏览器特别吃内存,所以小配置的云主机还不行。如果你要动态不固定ip,买ip代理池多好,云主机都不要买了。
我一直使用的oldiy/chrome-novnc,还算不错,就是不能大写输入。现在也在用“我不是矿神”里面的web浏览器,体验都不错。比较简单上手。
内核谷歌啊,那内存占用率不得高一些。
即用即关
我一般老是跑起来,忘记停了
-e VNC_PASSWORD=123456;ENABLE_CJK_FONT=1 \
这样?
多次-e 不能用分号来搞。
套娃浏览器是吧
对,套娃
飞牛自带了一个。
飞牛那个我还没试过,有空试试
搭建过,因为某个服务忘记了。
后来发现用处不大。
服务组网后,用途确实不大。