forked from trailofbits/algo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (31 loc) · 777 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
32
33
34
35
36
37
38
39
## docker-build: Build and tag a docker image
.PHONY: docker-build
IMAGE := trailofbits/algo
TAG := latest
DOCKERFILE := Dockerfile
CONFIGURATIONS := $(shell pwd)
docker-build:
docker build \
-t $(IMAGE):$(TAG) \
-f $(DOCKERFILE) \
.
## docker-deploy: Mount config directory and deploy Algo
.PHONY: docker-deploy
# '--rm' flag removes the container when finished.
docker-deploy:
docker run \
--cap-drop=all \
--rm \
-it \
-v $(CONFIGURATIONS):/data \
$(IMAGE):$(TAG)
## docker-clean: Remove images and containers.
.PHONY: docker-prune
docker-prune:
docker images \
$(IMAGE) |\
awk '{if (NR>1) print $$3}' |\
xargs docker rmi
## docker-all: Build, Deploy, Prune
.PHONY: docker-all
docker-all: docker-build docker-deploy docker-prune