Can you run GUI applications in a Docker container?

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

    OSX (10.13.6, high sierra)

    Similar to @Nick's answer, but his solution did not work for me.

    First install socat by doing brew install socat, and install XQuartz (https://www.xquartz.org/)

    Then followed these steps here (http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/) in the comments section:

    1. in one mac terminal i started:
    
    socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
    
    2. and in another mac terminal I ran:
    
    docker run -ti --rm \
    -e DISPLAY=$(ipconfig getifaddr en0):0 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    firefox
    

    I was also able to launch CLion from my debian docker container too.

提交回复
热议问题