summaryrefslogtreecommitdiff
path: root/Makefile
blob: 47c116ad0ebdf096f68bbc2ae91e15c2a16a5200 (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name = $(notdir $(realpath .))
host = $(name)
pwd = $(realpath .)
run-args = -itd --name $(host)
run-cmd = 


default: build


build: build-buildah

build-docker:
	docker  build --squash          -t $(name) $(pwd)

build-buildah:
	buildah bud   --squash --layers -t $(name) $(pwd)


run: run-podman

run-docker: stop-docker build-docker  wait start-docker

run-podman: stop-podman build-buildah wait start-podman


start: start-podman

start-docker:
	docker run --rm --cpus 1 $(run-args) $(name) $(run-cmd)

start-podman:
	podman run --rm          $(run-args) $(name) $(run-cmd)


stop: stop-podman

stop-docker:
	-docker stop    $(name)

stop-podman:
	-podman stop    $(name)


kill: kill-podman

kill-docker:
	-docker kill    $(name)

kill-podman:
	-podman kill    $(name)


restart: restart-podman

restart-docker:
	-docker restart $(name)

restart-podman:
	-podman restart $(name)


wait:
	sleep 1


log: log-podman

log-docker:
	docker logs $(name)

log-podman:
	podman logs $(name)


clean: clean-podman

clean-docker: kill-docker wait
	-docker image prune --force
	-docker container prune --force

clean-podman: kill-podman wait
	-buildah rm -a
	-podman image prune
	-podman container prune --force


shell: shell-podman

shell-docker: console-docker

shell-podman: console-podman


console: console-podman

console-docker:
	docker exec -it $(name) /bin/bash

console-podman:
	podman exec -it $(name) /bin/bash


status: status-podman

status-docker:
	docker exec -it $(name) /usr/bin/supervisorctl status

status-podman:
	podman exec -it $(name) /usr/bin/supervisorctl status