-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (45 loc) · 1.22 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
53
54
# These commands are used for development
uname := detrix
cname := hackbox
devtag := dev
vnc_port := 8080:8080
novnc_port := 5900:5900
env_file := .env
current_directory := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# Run even if file with same name exists
.PHONY: all build start compose box
# Quick build and start for development
all:
@$(MAKE) -s build
@$(MAKE) -s start
# Build curent container with dev tag
build:
docker build -t $(cname):$(devtag) .
# Start latest dev tagged container
start:
docker run --rm -it \
-p $(vnc_port) \
-p $(novnc_port) \
--mount type=bind,source="$(current_directory)/share",target=/share \
$(cname):$(devtag)
# Start docker-compose
compose:
docker-compose up
# Pull the latest version of the container
pull:
docker pull $(uname)/$(cname):latest
# Command to start the latest release version of the container
box:
@docker run --rm -it \
-p $(vnc_port) \
-p $(novnc_port) \
--mount type=bind,source="$(current_directory)/share",target=/share \
$(uname)/$(cname):latest
# Start a kali sandbox with connected share directory
sandbox:
docker run \
-it \
--rm \
--mount type=bind,source="$(current_directory)/share",target=/share \
kalilinux/kali-rolling:latest \
/bin/bash