$ brew install socat
$ brew cask install xquartz <--- assuming you don't already have XQuartz installed some other way
$ open -a XQuartz <--- start an XQuartz session
$ socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
In a new terminal:
$ inconfig
Look for the IP address assigned to your Docker VM; the interface will be something like vboxnet0
or vboxnet1
$ docker run --rm -e DISPLAY=[IP address of vboxnet0]:0 [image] [command]
For example, to run the Arduino IDE, I've used
$ docker run --rm -e DISPLAY=192.168.99.1:0 davechick/arduino-dev arduino
See moby/moby#8710 for more info
Hello
I make a little script to do that :
https://gist.github.com/kiki67100/5e1568ac783e8e4942b672f1090db2cd
Thanks for your script