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 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
brew install --cask xquartz