Created
December 22, 2019 10:27
-
-
Save roaldnefs/fe9f36b0e8cf2890af14572c083b516c to your computer and use it in GitHub Desktop.
Running GUI application in Docker on MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install XQuartz | |
brew cask install xquartz | |
# Restart MacOS | |
# Open XQuartz | |
open -a XQuartz | |
# Ensure the "Allow connections from network clients" option in Preferences >> Security is turned on | |
# Add localhost as an allowed source | |
xhost + 127.0.0.1 | |
# Run a Docker container, e.g. Firefox | |
docker run -e DISPLAY=host.docker.internal:0 -v /tmp/.X11-unix:/tmp/.X11-unix jess/firefox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should add directory to path to allow to run xhost
export PATH="/opt/X11/bin:$PATH"
Or use full path
/opt/X11/bin/xhost
Thanks to https://gist.github.com/cschiewek/246a244ba23da8b9f0e7b11a68bf3285?permalink_comment_id=3744661#gistcomment-3744661