Created
September 1, 2021 19:32
-
-
Save weldpua2008/c280f8f2e8f3bc369f13ef1dc75dbdbd to your computer and use it in GitHub Desktop.
This file contains 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 | |
get_ip(){ | |
ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}' |head -1 | |
} | |
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" | |
xhost +$(get_ip) | |
xhost + $(hostname) | |
docker run --rm -it ${VOLUMES} -e DISPLAY=$(ipconfig getifaddr en0):0.0 jess/firefox | |
#docker run -it --rm \ | |
# --net host \ | |
# --cpuset-cpus 0 \ | |
# --memory 512mb \ | |
# -v /tmp/.X11-unix:/tmp/.X11-unix \ | |
# -e DISPLAY=unix$DISPLAY \ | |
# -v $HOME/Downloads:/home/chrome/Downloads \ | |
# -v $HOME/docker/chrome/.config/google-chrome/:/data \ | |
# -v /dev/shm:/dev/shm \ | |
# --name chrome \ | |
# jess/chrome | |
docker run -it --rm \ | |
--privileged \ | |
--net host \ | |
--cpuset-cpus 0 \ | |
--cap-add SYS_ADMIN \ | |
--device /dev/dri \ | |
--memory 512mb \ | |
-e DISPLAY=$(ipconfig getifaddr en0):0.0 \ | |
-v $HOME/Downloads:/home/chrome/Downloads \ | |
-v $HOME/docker/chrome/.config/google-chrome/:/data \ | |
-v /dev/shm:/dev/shm \ | |
--name chrome \ | |
jess/chrome | |
docker run --rm -ti -e DISPLAY=docker.for.mac.host.internal:0 jamesnetherton/gimp | |
docker run -it \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix \ | |
-e DISPLAY=unix$DISPLAY \ | |
--name spotify \ | |
jess/spotify | |
xhost + | |
docker run -it \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket | |
-e DISPLAY=unix$DISPLAY \ # pass the display | |
--device /dev/snd \ # sound | |
--name spotify \ | |
jess/spotify | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment