Last active
May 30, 2021 22:43
-
-
Save rizky/96ef3ff65d0bba75b428598d711a3c03 to your computer and use it in GitHub Desktop.
Run GUI app from docker
This file contains hidden or 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 and Docker | |
brew cask install xquartz | |
brew cask install docker | |
# Open XQuartz | |
# In the XQuartz preferences, go to the “Security” tab | |
# Make sure you’ve got “Allow connections from network clients” ticked | |
open -a XQuartz | |
# Setup ENV | |
export IP=$(ifconfig -a | grep "inet " | sed 's/.*inet \([0-9\.]*\).*/\1/g' | grep -v "127.0.0.1" -m1) | |
export DISPLAY=$IP:0 | |
# Add ENV to XQuartz | |
/usr/X11/bin/xhost + | |
# Run Docker Image | |
docker run -d --name firefox -e DISPLAY=$IP:0 -v /tmp/.X11-unix:/tmp/.X11-unix jess/firefox |
Author
rizky
commented
May 29, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment