-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (44 loc) · 1.2 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
55
.PHONY: run debug build size version
VOLUMES=\
-v /boot:/host/boot:ro \
-v /etc:/host/etc:ro \
-v /proc:/host/proc:ro \
-v /run:/host/run:ro \
-v /sys:/host/sys:ro \
-v /usr:/host/usr:ro \
-v /var:/host/var:ro
OPTIONS=\
-it \
--privileged \
--rm \
--cap-add=NET_ADMIN \
--net=host \
--name container-check \
container-check
build:
docker build -t container-check .
run:
docker run ${VOLUMES} \
${OPTIONS} ./container_check --checks=./cis_checks
#-it --privileged --rm --name container-check container-check ./container_check --checks=./cis_checks:./checks
shell:
docker run ${VOLUMES} \
${OPTIONS} /bin/bash -i
debug:
docker run ${VOLUMES} \
${OPTIONS} ./container_check --debug
test:
docker run ${VOLUMES} \
${OPTIONS} ./checking/unittest_coverage.py
version:
docker run \
${OPTIONS} ./container_check --version
help: build
docker run \
${OPTIONS} ./container_check --help
size:
@docker image list container-check --format 'Current Size: {{.Repository}} {{.Size}}\n'
clean: size
find . -type f -name '*.pyc' -exec rm '{}' ';' ||:
docker ps --all --filter 'status=exited' --format '{{.ID}}' | xargs docker rm ||:
docker image list --filter 'dangling=true' --format '{{.ID}}' | xargs docker rmi ||: