-
Notifications
You must be signed in to change notification settings - Fork 44
/
crawl.sh
executable file
·49 lines (45 loc) · 1.15 KB
/
crawl.sh
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
#!/bin/bash
# Start the crawler as a container.
# Arguments passed to this script will be passed to the crawler.
CRAWLER_ARGS=`echo $@ | awk '{for (i = 2; i <= NF; i++) print $i}'`
case "$1" in
help*)
docker run -it crawler --help
;;
host*)
docker run \
--privileged \
--net=host \
--pid=host \
-v /cgroup:/cgroup:ro \
-v /var/lib/docker:/var/lib/docker:ro \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-it crawler --crawlmode INVM ${CRAWLER_ARGS}
;;
containers*)
docker run \
--privileged \
--net=host \
--pid=host \
-v /cgroup:/cgroup:ro \
-v /var/lib/docker:/var/lib/docker:ro \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-it crawler --crawlmode OUTCONTAINER ${CRAWLER_ARGS}
;;
none*)
docker run \
--privileged \
--net=host \
--pid=host \
-v /cgroup:/cgroup:ro \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
--entrypoint=/bin/bash \
-it crawler
;;
*)
echo $"Usage: $0 {host|containers|help|none}"
exit 1
esac