The host.docker.internal and vm.docker.internal DNS entries now resolve. We removed hard-coded IP addresses: it now dynamically discovers the IP allocated by macOS. Osxfs file sharing now works. We made a configuration change that should improve disk performance. The Restart option in the Docker menu works. Difference between Docker on Linux and Docker on Mac/Windows environments Based on your OS, your DOCKERHOST is different. On Linux, it will simply be your localhost. For Mac/Windows, you should obtain the appropriate IP using the following command.

This is a short guide explaining how to run GUI applications from within Docker on Mac. This uses XQuartz to enable to set the DISPLAY
variable within the container.
Install XQuartz
You can install XQuartz using homebrew with brew cask install xquartz
or directly from the website here. At the time of writing, I had 2.7.11
installed on my machine with OSX El Capitan. After installing XQuartz restart your machine.
Install Docker for Mac


Install docker using brew cask install docker
or directly from the website here.
Run XQuartz

Docker For Mac Machine Ipad
Start XQuartz from command line using open -a XQuartz
. In the XQuartz preferences, go to the “Security” tab and make sure you’ve got “Allow connections from network clients” ticked:
Host Machine IP
IP=$(ifconfig en0 | grep inet | awk '$1'inet' {print $2}')
should set the IP
variable as the ip of your local machine. If you’re on wifi you may want to use en1
instead of en0
, check the value of the variable using echo $IP
.
Now add the IP using Xhost with xhost + $IP
. If the xhost command is not found check /usr/X11/bin/xhost
as that might not be in your path.
Running a container
You can now try running firefox in your container with:
Docker For Mac Machine Iphone
or run octave using: