...menustart
...menuend
https://fredrikaverpil.github.io/2016/07/31/docker-for-mac-and-gui-applications/
brew install xquartz
reboot Mac
- run XQuartz
open -a XQuartz
- a xterm window should popup
- In the XQuartz preferences, go to the “Security” tab and make sure you’ve got “Allow connections from network clients”
- run xhost and allow connections from your local machine
ip=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}') xhost + $ip
- find your displaynumber
display_number=`ps -ef | grep "Xquartz :\d" | grep -v xinit | awk '{ print $9; }'` echo $display_number
- test an GUI app, e.g. firefox
docker run --rm --name firefox -e DISPLAY=$ip:0 -v /tmp/.X11-unix:/tmp/.X11-unix jess/firefox
import matplotlib
matplotlib.use('tkagg')
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
plt.show()