Skip to content

Instantly share code, notes, and snippets.

@pklaus
Forked from slok/run_docker_x11.sh
Last active May 13, 2019 14:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pklaus/951ee9e9dbb08b57e164f7c432573b04 to your computer and use it in GitHub Desktop.
Save pklaus/951ee9e9dbb08b57e164f7c432573b04 to your computer and use it in GitHub Desktop.
x11 with docker archlinux
#!/bin/bash
KEY=$(xauth list | grep "$(hostname)/unix:0" | awk '{ print $3 }' | head -n 1)
CONT_HOSTNAME=docker-skype
xauth add $CONT_HOSTNAME/unix:0 . $KEY
docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.Xauthority:/tmp/.Xauthority \
-v /dev/snd:/dev/snd \
-e DISPLAY=unix$DISPLAY \
-e XAUTHORITY=/tmp/.Xauthority \
-h $CONT_HOSTNAME \
arch_image_with_xorg-xclock_package \
xclock
xauth remove $CONT_HOSTNAME/unix:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment