-
Notifications
You must be signed in to change notification settings - Fork 41
/
docker.sh
executable file
·46 lines (42 loc) · 1.13 KB
/
docker.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
#!/usr/bin/env bash
#
# 2020 @leonjza
#
# Part of the frida-boot workshop
# https://github.com/leonjza/frida-boot
if ! hash docker 2>/dev/null; then
echo "Docker is required. Please install it first!"
exit 1
fi
if ! [[ "$1" =~ ^(pull|build|run|run-dev|shell)$ ]]; then
echo "Usage: $0 [action]"
echo " Actions can be: pull; build; run; run-dev; shell"
exit 1
fi
case $1 in
pull)
echo "> pulling latest workshop image"
docker pull leonjza/frida-boot
;;
build)
echo "> building a local image"
docker build -t frida-boot:local .
;;
run)
echo "> starting a new container"
echo
docker run --cap-add SYS_PTRACE --rm -it --name frida-boot -p9999:80 \
-v $(pwd)/code:/root/code leonjza/frida-boot
;;
run-dev)
echo "> runing a content dev instance"
echo "> webserver exposed on port 9999"
docker run --cap-add SYS_PTRACE --rm -it --name frida-boot -p9999:80 \
-v $(pwd)/code:/root/code \
-v $(pwd)/course:/var/www/html frida-boot:local
;;
shell)
echo "> spawning new shell in the frida-boot container"
docker exec -it frida-boot /bin/bash
;;
esac