-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
52 lines (40 loc) · 1.34 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
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/
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="START_XVFB=false" \
--env="TBB_PATH=${TBB_PATH}"
VOLUMES = \
--volume=${XSOCK}:${XSOCK} \
--volume=${XAUTH}:${XAUTH} \
--volume=${HOST_SSH}:${GUEST_SSH} \
--volume=`pwd`:${CRAWL_PATH} \
# network interface on which to listen
DEVICE=ens5
# commandline arguments
CRAWL_PARAMS=-c walsh -u ./videos.txt --timeout 10 -s -d ${DEVICE} -v
# Make routines
build:
@docker build -t tbcrawl --rm .
run:
@docker run -it --rm ${ENV_VARS} ${VOLUMES} --net host --privileged --memory 1024mb --shm-size 1024mb \
tbcrawl python3 bin/tbcrawler.py $(CRAWL_PARAMS)
run-without-tor:
@docker run -it --rm ${ENV_VARS} ${VOLUMES} --net host --privileged --memory 1024mb --shm-size 1024mb \
tbcrawl python3 bin/tbcrawler.py $(CRAWL_PARAMS) --without-tor
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