-
Notifications
You must be signed in to change notification settings - Fork 11
/
GNUmakefile
45 lines (35 loc) · 1.11 KB
/
GNUmakefile
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
NAME = imunes/template
TAGS = debian-12-min debian-12 arm64 latest-min latest
clean_TAGS = $(addprefix clean_,$(TAGS))
push_TAGS = $(addprefix push_,$(TAGS))
.PHONY: $(TAGS) $(clean_TAGS) $(push_TAGS)
info:
@echo "To print all imunes images: make print"
@echo "To build an image use: make name"
@echo "To remove an image use: make clean_name"
@echo "To push an image use: make push_name"
@echo "To build all images use: make build_all"
@echo "To remove all images use: make clean_all"
@echo "To push all images use: make push_all"
print:
docker images $(NAME)
$(TAGS):
./build.sh $@
$(clean_TAGS):
docker rmi $(NAME):$(patsubst clean_%,%,$@)
$(push_TAGS):
docker login
docker push $(NAME):$(patsubst push_%,%,$@)
build_all: $(TAGS)
clean_none:
docker rmi `docker images | grep '^<none>' | awk '{print $3}'` 2> /dev/null || true
docker rmi `docker images $(NAME) | grep '<none>' | awk '{print $3}'` 2> /dev/null || true
clean_all: clean_none
for tag in $(TAGS); do \
docker rmi $(NAME):$$tag 2> /dev/null || true; \
done
push_all:
docker login
for tag in $(TAGS); do \
docker push $(NAME):$$tag ; \
done