Can you run GUI applications in a Docker container?

前端 未结 22 2891
南旧
南旧 2020-11-22 06:12

How can you run GUI applications in a Docker container?

Are there any images that set up vncserver or something so that you can - for example - add an e

22条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 06:30

    Docker with BRIDGE network. for Ubuntu 16.04 with display manager lightdm:

    cd /etc/lightdm/lightdm.conf.d
    sudo nano user.conf
    
    [Seat:*]
    xserver-allow-tcp=true
    xserver-command=X -listen tcp
    

    you can use more private permissions

    xhost +
    
    docker run --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --env="DISPLAY=$HOST_IP_IN_BRIDGE_NETWORK:0" --net=bridge $container_name
    

提交回复
热议问题