Skip to content

Instantly share code, notes, and snippets.

@fsmunoz
Created October 24, 2017 21:13
Show Gist options
  • Save fsmunoz/d83dbcf6c60b651491e0815b12158d1c to your computer and use it in GitHub Desktop.
Save fsmunoz/d83dbcf6c60b651491e0815b12158d1c to your computer and use it in GitHub Desktop.
Docker alias file (RHEL host)
### DOCKER ALIAS
## Sound options for RHEL7 OpenClient
snd_opts="--device /dev/snd \
-e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
-v ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native:Z \
--group-add $(getent group audio | cut -d: -f3)"
x11_opts="-e DISPLAY=unix$DISPLAY \
--ipc=host \
-v /dev/dri/:/dev/dri/:Z \
-v /tmp/.X11-unix:/tmp/.X11-unix:Z"
user_opts="-u $(id -u) \
-e USER=$USER \
-e USERNAME=$USERNAME \
-e LOGNAME=$LOGNAME \
-v ~/Downloads/:/tmp/Downloads/:Z"
dbus_opts="-v /var/run/dbus:/var/run/dbus:Z \
-v /var/run/dbus:/run/dbus:Z \
-v /etc/machine-id:/etc/machine-id:ro \
--net=host \
-e DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS"
## The actual containers start here.
alias debian="docker run --rm -it \
--name debian \
$snd_opt \
$dbus_opts \
$x11_opts \
-v $HOME/src:/src:Z \
debian"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment