Can you run GUI applications in a Docker container?

前端 未结 22 2488
南旧
南旧 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:40

    You can allow the Docker user (here: root) to access the X11 display:

    XSOCK=/tmp/.X11-unix
    xhost +SI:localuser:root 
    docker run -t -i --rm -v $XSOCK:$XSOCK:ro -e DISPLAY=unix$(DISPLAY) image 
    xhost -SI:localuser:root
    

提交回复
热议问题