2015-06-23 17:27:41 +00:00
|
|
|
all: build
|
2014-09-22 20:02:55 +00:00
|
|
|
|
2015-07-12 03:49:34 +00:00
|
|
|
XSOCK=/tmp/.X11-unix
|
|
|
|
XAUTH=/tmp/.docker.xauth
|
|
|
|
|
2015-07-12 07:18:41 +00:00
|
|
|
CAPABILITIES = \
|
|
|
|
--cap-add=SYS_ADMIN
|
|
|
|
|
2015-09-29 22:53:32 +00:00
|
|
|
ENV_VARS = \
|
2015-07-12 07:18:41 +00:00
|
|
|
--env="USER_UID=$(shell id -u)" \
|
|
|
|
--env="USER_GID=$(shell id -g)" \
|
|
|
|
--env="DISPLAY" \
|
2015-07-12 07:21:20 +00:00
|
|
|
--env="XAUTHORITY=${XAUTH}"
|
2015-07-12 07:18:41 +00:00
|
|
|
|
|
|
|
VOLUMES = \
|
|
|
|
--volume=${XSOCK}:${XSOCK} \
|
|
|
|
--volume=${XAUTH}:${XAUTH} \
|
|
|
|
--volume=/run/user/$(shell id -u)/pulse:/run/pulse
|
|
|
|
|
2015-09-29 22:53:32 +00:00
|
|
|
ENV_INSTL_USER = \
|
|
|
|
--env="BROWSER_BOX_USER=${USER}"
|
|
|
|
|
|
|
|
ifdef CHROME_USERDATA
|
|
|
|
ENV_CHROME_USERDATA = \
|
|
|
|
--env="CHROME_USERDATA=${CHROME_USERDATA}"
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef FIREFOX_USERDATA
|
|
|
|
ENV_FIREFOX_USERDATA = \
|
|
|
|
--env="FIREFOX_USERDATA=${FIREFOX_USERDATA}"
|
|
|
|
endif
|
|
|
|
|
2014-09-22 20:02:55 +00:00
|
|
|
help:
|
|
|
|
@echo ""
|
|
|
|
@echo "-- Help Menu"
|
|
|
|
@echo ""
|
2014-11-24 07:37:36 +00:00
|
|
|
@echo " 1. make build - build the browser-box image"
|
2014-09-22 20:02:55 +00:00
|
|
|
@echo " 1. make install - install launch wrappers"
|
|
|
|
@echo " 2. make google-chrome - launch google-chrome"
|
|
|
|
@echo " 2. make tor-browser - launch tor-browser"
|
|
|
|
@echo " 2. make bash - bash login"
|
|
|
|
@echo ""
|
|
|
|
|
2015-09-29 22:53:32 +00:00
|
|
|
clean:
|
|
|
|
@docker rm -f `docker ps -a | grep "${USER}/browser-box" | awk '{print $$1}'` > /dev/null 2>&1 || exit 0
|
|
|
|
@docker rmi `docker images | grep "${USER}/browser-box" | awk '{print $$3}'` > /dev/null 2>&1 || exit 0
|
|
|
|
|
|
|
|
|
2014-09-22 20:02:55 +00:00
|
|
|
build:
|
2015-09-29 22:53:32 +00:00
|
|
|
@docker build --rm=true --tag=${USER}/browser-box .
|
2014-09-22 20:02:55 +00:00
|
|
|
|
2014-10-26 14:05:54 +00:00
|
|
|
install uninstall: build
|
2014-09-22 20:02:55 +00:00
|
|
|
@docker run -it --rm \
|
|
|
|
--volume=/usr/local/bin:/target \
|
2015-09-29 22:53:32 +00:00
|
|
|
${ENV_CHROME_USERDATA} \
|
|
|
|
${ENV_FIREFOX_USERDATA} \
|
|
|
|
${ENV_INSTL_USER} \
|
2014-11-24 07:37:36 +00:00
|
|
|
${USER}/browser-box:latest $@
|
2014-09-22 20:02:55 +00:00
|
|
|
|
2015-03-25 13:54:26 +00:00
|
|
|
google-chrome tor-browser chromium-browser firefox bash:
|
2015-07-12 03:49:34 +00:00
|
|
|
@touch ${XAUTH}
|
|
|
|
@xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f ${XAUTH} nmerge -
|
2015-07-12 07:18:41 +00:00
|
|
|
docker run -it --rm \
|
|
|
|
${CAPABILITIES} \
|
|
|
|
${ENV_VARS} \
|
|
|
|
${VOLUMES} \
|
2014-11-24 07:37:36 +00:00
|
|
|
${USER}/browser-box:latest $@
|