启动firefox-inside容器会在主机firefox中创建新窗口



我目前正在尝试制作一个连接到VPN的docker容器(通过openforivpn(,并打开一个Firefox实例与该连接一起使用。当我的主机上没有运行Firefox时,一切都很好,容器启动VPN连接,打开连接到我的X服务器的Firefox应用程序。但是,如果我的主机Firefox正在运行,当我启动容器时,它会在主机Firefox上打开一个新窗口,并退出容器并显示消息:

feulo@branca:~/vpen-test$ docker-compose up
Recreating 07_complex_compose_openfortivpn_1 ... done
Attaching to 07_complex_compose_openfortivpn_1
07_complex_compose_openfortivpn_1 exited with code 0

有人知道怎么修吗?感谢的帮助

这些是反Dockerfiledocker-compose.yml文件

Dockerfile

# Use an official Debian Slim image
FROM debian:buster-slim 
# Install needed packages
RUN  apt update 
&&  DEBIAN_FRONTEND="noninteractive" apt -y install  dbus ppp openfortivpn iceweasel

docker-compose.yml

version: '3.2'
services:
openfortivpn:
working_dir: /workdir
build: .
privileged: true
devices:
- /dev/snd
volumes:
- .:/workdir
- /tmp/.X11-unix:/tmp/.X11-unix
environment:
- DISPLAY=unix$DISPLAY
command:  sh entrypoint.sh

入口点.sh

openfortivpn -c dti.txt &
firefox

在Docker中找到了共享X11套接字的解决方案:为什么它能"开始";容器外的Firefox?

只需要将-new-instance添加到Firefox

最新更新