-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 781 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
40
41
DOCKER_IMAGE=megbeguk/zabbix-server-pg
DOCKER_CONTAINER=zabbix-server
VOL_DANG=$(docker volume ls -qf dangling=true)
IMG_DANG=$(docker images -f "dangling=true" -q)
# set param from cmd:
# make build DB_HOST="X.X.X.X" DB_PORT="YYYY" PG_PASS="ZZZZZZZZ"
#
list:
docker ps -a
docker images -a
build:
docker build -t $(DOCKER_IMAGE) src/
docker images -a | grep $(DOCKER_IMAGE)
log:
docker logs $(DOCKER_CONTAINER)
rm:
docker stop $(DOCKER_CONTAINER)
docker rm $(DOCKER_CONTAINER)
rmi:
docker rmi $(DOCKER_IMAGE)
ifeq ("$(VOL_DANG)", "")
@echo "dangling volumes: none"
else
@echo "remove dangling volumes:"
docker volume rm $(VOL_DANG)
endif
ifeq ("$(IMG_DANG)","")
@echo "dangling images: none"
else
@echo "remove dangling images:"
docker rmi $(IMG_DANG)
endif