forked from webfp/tor-browser-crawler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 1005 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
all: build test stop
# this is to forward X apps to host:
# See: http://stackoverflow.com/a/25280523/1336939
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
# paths
TBB_PATH=/home/docker/tbcrawl/tor-browser_en-US/
CRAWL_PATH=/home/docker/tbcrawl
GUEST_SSH=/home/docker/.ssh
HOST_SSH=${HOME}/.ssh
ENV_VARS = \
--env="DISPLAY=${DISPLAY}" \
--env="XAUTHORITY=${XAUTH}" \
--env="VIRTUAL_DISPLAY=$(VIRTUAL_DISPLAY)" \
--env="TBB_PATH=${TBB_PATH}"
VOLUMES = \
--volume=${XSOCK}:${XSOCK} \
--volume=${XAUTH}:${XAUTH} \
--volume=${HOST_SSH}:${GUEST_SSH} \
--volume=`pwd`:${CRAWL_PATH} \
PARAMS=-c wang_and_goldberg -t WebFP -u ./etc/localized-urls-100-top.csv -s
build:
@docker build -t tbcrawl --rm .
run:
@docker run -it --rm ${ENV_VARS} ${VOLUMES} --privileged tbcrawl ${CRAWL_PATH}/Entrypoint.sh "$(PARAMS)"
stop:
@docker stop `docker ps -a -q -f ancestor=tbcrawl`
@docker rm `docker ps -a -q -f ancestor=tbcrawl`
destroy:
@docker rmi -f tbcrawl
reset: stop destroy