Skip to content

Instantly share code, notes, and snippets.

@danidiaz
Last active October 17, 2015 06:46
Show Gist options
  • Save danidiaz/04c5999edad814e0aa59 to your computer and use it in GitHub Desktop.
Save danidiaz/04c5999edad814e0aa59 to your computer and use it in GitHub Desktop.
Docker & X11 shenanigans
docker run centos yum install -y xorg-x11-xauth xeyes
docker ps -l
docker commit zzzzzzzzzz centos:xeyes
docker run -v $HOME:/hosthome:ro -e XAUTHORITY=/hosthome/.Xauthority -e DISPLAY=$DISPLAY centos cat /hosthome/.Xauthority
docker run -v $HOME:/hosthome:ro -e XAUTHORITY=/hosthome/.Xauthority -e DISPLAY=$(echo $DISPLAY | sed "s/^.*:/$(hostname -i):/") centos:xeyes xeyes
alias dockerX11run='docker run -v $HOME:/hosthome:ro -e XAUTHORITY=/hosthome/.Xauthority -e DISPLAY=$(echo $DISPLAY | sed "s/^.*:/$(hostname -i):/")'
dockerX11run centos:xeyes xeyes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment