-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (58 loc) · 1.27 KB
/
Makefile
File metadata and controls
76 lines (58 loc) · 1.27 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
CONTAINER_NAME = flypenguin/test
COLORS = orange red blue green yellow magenta navy white black
RUN_COLOR = white
build-one:
docker buildx build --platform linux/amd64 -t $(CONTAINER_NAME) -f Dockerfile .
.PHONY: build-one
build-all: build-one
# https://is.gd/jxU0eq
for COLOR in $(COLORS) ; do \
docker buildx build --platform linux/amd64 \
--build-arg TAG_COLOR=$$COLOR \
-t $(CONTAINER_NAME):$$COLOR \
-f Dockerfile.color \
. ; \
done ;
.PHONY: build-all
build: build-all
.PHONY: build
push: build
docker push $(CONTAINER_NAME)
echo $(COLORS) | tr " " "\n" | parallel docker push $(CONTAINER_NAME):{}
.PHONY: push
push-all: push
.PHONY: push-all
upload: push
.PHONY: upload
upload-all: push
.PHONY: upload-all
run: build-one
docker run --rm -e FLASK_PORT=8000 -e COLOR=$(RUN_COLOR) -p 8000:8000 $(CONTAINER_NAME)
.PHONY: run
orange: RUN_COLOR=orange
orange: run
.PHONY: orange
red: RUN_COLOR=red
red: run
.PHONY: red
blue: RUN_COLOR=blue
blue: run
.PHONY: blue
green: RUN_COLOR=green
green: run
.PHONY: green
yellow: RUN_COLOR=yellow
yellow: run
.PHONY: yellow
magenta: RUN_COLOR=magenta
magenta: run
.PHONY: magenta
navy: RUN_COLOR=navy
navy: run
.PHONY: navy
white: RUN_COLOR=white
white: run
.PHONY: white
black: RUN_COLOR=black
black: run
.PHONY: black