-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
58 lines (44 loc) · 1.21 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
56
57
58
# Makefile
#
# build
#
-include *.mk
BLD_ARG ?= --build-arg DIST=alpine --build-arg REL=3.21
BLD_REPO ?= mlan/postfix
BLD_VER ?= latest
BLD_TGT ?= full
BLD_TGTS ?= base full
BLD_CMT ?= HEAD
TST_REPO ?= $(BLD_REPO)
TST_VER ?= $(BLD_VER)
TST_ENV ?= -C test
TST_TGTE ?= $(addprefix test-,all diff down env htop imap logs mail mail-send pop3 sh sv up)
TST_INDX ?= 1 2 3 4 5
TST_TGTI ?= $(addprefix test_,$(TST_INDX)) $(addprefix test-up_,0 $(TST_INDX))
export TST_REPO TST_VER
push:
#
# PLEASE REVIEW THESE IMAGES WHICH ARE ABOUT TO BE PUSHED TO THE REGISTRY
#
@docker image ls $(BLD_REPO)
#
# ARE YOU SURE YOU WANT TO PUSH THESE IMAGES TO THE REGISTRY? [yN]
@read input; [ "$${input}" = "y" ]
docker push --all-tags $(BLD_REPO)
build-all: $(addprefix build_,$(BLD_TGTS))
build: build_$(BLD_TGT)
build_%: Dockerfile
docker build $(BLD_ARG) --target $* \
$(addprefix --tag $(BLD_REPO):,$(call bld_tags,$*,$(BLD_VER))) .
variables:
make -pn | grep -A1 "^# makefile"| grep -v "^#\|^--" | sort | uniq
ps:
docker ps -a
prune:
docker image prune -f
clean:
docker images | grep $(BLD_REPO) | awk '{print $$1 ":" $$2}' | uniq | xargs docker rmi
$(TST_TGTE):
${MAKE} $(TST_ENV) $@
$(TST_TGTI):
${MAKE} $(TST_ENV) $@