-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (34 loc) · 1.3 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
build-hello:
$(info "")
$(info Bulding with Debian Linux base image...)
docker build -f dockerfiles/1/Dockerfile -t hello-1-debian .
run-hello:
docker run -p 8080:8080 hello-1-debian
build-hello-alpine:
$(info "")
$(info Building with Alpine Linux base image...)
docker build -f dockerfiles/2/Dockerfile -t hello-2-alpine .
run-hello-alpine:
docker run -p 8080:8080 hello-2-alpine
build-hello-multi-stage:
$(info "")
$(info Building with Alpine Linux using multi stage compilation...)
docker build -f dockerfiles/3/Dockerfile -t hello-3-multi-stage .
run-hello-multi-stage:
docker run -p 8080:8080 hello-3-multi-stage
build-hello-ms-scratch:
$(info "")
$(info Building with multi stage compilation, and the scratch image....)
docker build -f dockerfiles/4/Dockerfile -t hello-4-ms-scratch .
run-hello-ms-scratch:
docker run -p 8080:8080 hello-4-ms-scratch
build-all: build-hello build-hello-alpine build-hello-multi-stage build-hello-ms-scratch
list-images:
docker images|grep hello-|sort -k1nr
count-image-layers:
docker history hello-1-debian| tail -n +2|wc -l
docker history hello-2-alpine| tail -n +2|wc -l
docker history hello-3-multi-stage| tail -n +2|wc -l
docker history hello-4-ms-scratch| tail -n +2|wc -l
remove-images:
docker images|grep hello-|awk '{print $3}'|xargs docker rmi -f