/
Makefile
31 lines (23 loc) · 811 Bytes
/
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
.PHONY: build img
BINNAME := /bin/volatility2docker
IMGNAME := volatility2docker
all : build
build:
docker build -t $(IMGNAME):latest -f Dockerfile .
install: build
@if [ -f $(BINNAME) ]; then sudo rm -rf $(BINNAME); fi
@printf '#!/bin/bash\ndocker run -it -v "$$(pwd):/workspace" $(IMGNAME) $${@}\n' | sudo tee -a $(BINNAME) > /dev/null
@sudo chmod +x $(BINNAME)
@if [ -f $(BINNAME) ]; then \
echo "[+] Installed successfully in $(BINNAME)"; \
else \
echo '[!] Installation of $(BINNAME) failed.'; \
fi
start: build
docker run --rm -it $(IMGNAME)
background:
docker run --rm -d $(IMGNAME)
shell:
docker exec -it $(shell docker ps | grep $(IMGNAME) | awk '{split($$0,a," "); print a[1]}') bash
stop:
docker stop $(shell docker ps | grep $(IMGNAME) | awk '{split($$0,a," "); print a[1]}')