Run GUI apps in containier in OSX (docker for mac)
Run XQuartz
- Update preferences 'Security' tab - turn on 'Allow connection from network clients'
- Restart XQuartz and then check to see that it is listening on port 6000:
lsof -i :6000
Install socat
And run it so it will wait for connections and then pass them over to XQuartz.
brew install socat
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
Get your local machine's IP:
ip=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}') && echo "My IP is: $ip"
Allow the local machine to talk to XQuartz
xhost + ${ip}
Run your docker host:
docker run --rm -it -e DISPLAY=${ip}:0 -v /tmp/.X11-unix:/tmp/.X11-unix --name firefox jess/firefox
Now you can do stuff described here
Written by dra1n
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Docker x11 socat display xquartz
Authors
Related Tags
#docker x11 socat display xquartz
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#