Run X11 apps in Docker in macOS
Based on this tutorial
1.- Get Ip address
export IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
2.- Open XQuartz
3.- Execute docker
xhost +$IP
$ docker run --rm --name firefox -e DISPLAY=$IP:0 -e XAUTHORITY=/.Xauthority --net host -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/.Xauthority:/.Xauthority jess/firefox
4.- Running the below command we get Firefox for Ubuntu displaying on a Mac OS X desktop.
xhost +local:docker