forked from ThePorgs/Exegol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (40 loc) · 2.06 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
.PHONY: help install update install-from-sources update-from-sources start start-proxmark start-gui shell resume pause kill
TARGETS := $(MAKEFILE_LIST)
# Image name
NAME = nwodtuhs/exegol
# Name given to the docker hostname
HOSTNAME = exegol
# GitHub branch to pull sources from
BRANCH = master
# Image tag for install/update
TAG = latest
# Absolute path to the Makefile
EXEGOL_PATH = $(shell pwd)
# Path to the shared-volume
SHARE = $(EXEGOL_PATH)/shared-volume
# Name given to the container, useful for docker run/start/stop/rm
CONTAINER_NAME = exegol-$(tag)
help: ## [Help] This help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(TARGETS) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: ## [Docker] pull exegol from the latest automatic build on DockerHub
docker pull $(NAME):$(TAG)
update: ## [Docker] update exegol from the latest automatic build on DockerHub
docker pull $(NAME):$(TAG)
install-from-sources: ## [Docker] build exegol from the sources cloned from GitHub
docker build --tag $(NAME):$(TAG) $(EXEGOL_PATH)
update-from-sources: ## [Docker] update exegol from the sources cloned from GitHub
git -C $(EXEGOL_PATH) pull origin $(BRANCH)
docker build --no-cache --pull --tag $(NAME):$(TAG) $(EXEGOL_PATH) | tee $(EXEGOL_PATH)/.build.log
start: ## [Docker] start exegol
docker run --interactive --tty --detach --network host --volume $(SHARE):/share --name $(CONTAINER_NAME) --hostname $(HOSTNAME) $(NAME):$(TAG)
start-proxmark: ## [Docker] start exegol with device sharing (/dev/ttyACM0) to use proxmark
docker run --device /dev/ttyACM0 --interactive --tty --detach --network host --volume $(SHARE):/share --name $(CONTAINER_NAME) --hostname $(HOSTNAME) $(NAME):$(TAG)
shell: ## [Docker] get a shell (exegol needs to be started first)
docker exec -ti $(CONTAINER_NAME) zsh
resume: ## [Docker] resume after a pause from the saved state
docker start $(CONTAINER_NAME)
pause: ## [Docker] pause exegol in a saved state
docker stop $(CONTAINER_NAME)
kill: ## [Docker] reset exegol
docker stop $(CONTAINER_NAME)
docker rm $(CONTAINER_NAME)