Skip to content

Instantly share code, notes, and snippets.

@bahorn
Created March 12, 2018 21:09
Show Gist options
  • Save bahorn/27b0e9455f363ead05e41f6819d7ea2e to your computer and use it in GitHub Desktop.
Save bahorn/27b0e9455f363ead05e41f6819d7ea2e to your computer and use it in GitHub Desktop.
Docker GUI.
#!/bin/bash
IMAGE=<IMAGE_HERE>
CONTAINERNAME=<NAME_HERE>
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run -dt \
--name $CONTAINERNAME \
-p 4444:4444 \
-v $XSOCK:$XSOCK \
-v $XAUTH:$XAUTH \
-e XAUTHORITY=$XAUTH \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
--device /dev/snd \
--memory 512mb \
$IMAGE tail -f /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment