mirror of
https://github.com/sameersbn/docker-browser-box
synced 2024-11-15 00:15:08 +00:00
browser-box: support newer xorg systems, closes #1 (untested)
This commit is contained in:
parent
198a355e42
commit
6ed2bc7854
12
Makefile
12
Makefile
@ -1,5 +1,8 @@
|
||||
all: build
|
||||
|
||||
XSOCK=/tmp/.X11-unix
|
||||
XAUTH=/tmp/.docker.xauth
|
||||
|
||||
help:
|
||||
@echo ""
|
||||
@echo "-- Help Menu"
|
||||
@ -20,10 +23,15 @@ install uninstall: build
|
||||
${USER}/browser-box:latest $@
|
||||
|
||||
google-chrome tor-browser chromium-browser firefox bash:
|
||||
@docker run -it --rm --cap-add=SYS_ADMIN \
|
||||
@touch ${XAUTH}
|
||||
@xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f ${XAUTH} nmerge -
|
||||
@docker run -it --rm \
|
||||
--cap-add=SYS_ADMIN \
|
||||
--env="USER_UID=$(shell id -u)" \
|
||||
--env="USER_GID=$(shell id -g)" \
|
||||
--env="DISPLAY" \
|
||||
--volume=/tmp/.X11-unix:/tmp/.X11-unix \
|
||||
--env="XAUTHORITY=${XAUTH}" \
|
||||
--volume=${XSOCK}:${XSOCK} \
|
||||
--volume=${XAUTH}:${XAUTH} \
|
||||
--volume=/run/user/$(shell id -u)/pulse:/run/pulse \
|
||||
${USER}/browser-box:latest $@
|
||||
|
@ -11,6 +11,10 @@ else
|
||||
USER_UID=$(id -u)
|
||||
USER_GID=$(id -g)
|
||||
|
||||
XSOCK=/tmp/.X11-unix
|
||||
XAUTH=/tmp/.docker.xauth
|
||||
xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f ${XAUTH} nmerge -
|
||||
|
||||
# remove stopped containers
|
||||
echo "Removing stopped containers..."
|
||||
for c in $(docker ps -a -q)
|
||||
@ -25,12 +29,15 @@ else
|
||||
done
|
||||
|
||||
echo "Starting ${prog}..."
|
||||
touch ${XAUTH}
|
||||
docker run -d \
|
||||
--cap-add=SYS_ADMIN \
|
||||
--env="USER_UID=${USER_UID}" \
|
||||
--env="USER_GID=${USER_GID}" \
|
||||
--env="DISPLAY" \
|
||||
--volume=/tmp/.X11-unix:/tmp/.X11-unix \
|
||||
--env="XAUTHORITY=${XAUTH}" \
|
||||
--volume=${XSOCK}:${XSOCK} \
|
||||
--volume=${XAUTH}:${XAUTH} \
|
||||
--volume=/run/user/${USER_UID}/pulse:/run/pulse \
|
||||
sameersbn/browser-box:latest $(basename $0) $@ >/dev/null
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user