Created
June 24, 2019 06:58
-
-
Save ddm/ef84515418325bfdd6730d7ec5b50dc8 to your computer and use it in GitHub Desktop.
X11 Docker Apps with XQuartz xterm
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
#!/usr/bin/env bash | |
COMMAND=$1 | |
pushd `dirname $0` > /dev/null | |
DIR=`pwd -P` | |
popd > /dev/null | |
cd $DIR | |
rm -rf $DIR/.X11-unix | |
mkdir -p $DIR/.X11-unix | |
ln -s /tmp/.X11-unix/X0 $DIR/.X11-unix/X0 | |
ip=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}') | |
xhost + $ip | |
docker run -t -i -e DISPLAY=$ip:0 -v $DIR/.X11-unix:/tmp/.X11-unix $COMMAND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment