docker-browser-box/Makefile

68 lines
1.7 KiB
Makefile
Raw Normal View History

2015-06-23 17:27:41 +00:00
all: build
2014-09-22 20:02:55 +00:00
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
2015-07-12 07:18:41 +00:00
CAPABILITIES = \
--cap-add=SYS_ADMIN
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
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 ""
@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 ""
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:
@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 \
${ENV_CHROME_USERDATA} \
${ENV_FIREFOX_USERDATA} \
${ENV_INSTL_USER} \
${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:
@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} \
${USER}/browser-box:latest $@