summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: c74e2a48d54e6e5d52cfa093d87d2761f33b9130 (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
all: build
install: push

.PHONY: rebuild build push start stop restart bash logs

build: Dockerfile
	podman build --cap-add=CAP_SYS_PTRACE --tag chsa/distcc:latest .

rebuild: Dockerfile
	podman build --no-cache --cap-add=CAP_SYS_PTRACE --tag chsa/distcc:latest .

push: build
	podman push chsa/distcc:latest

start: build
	if [ `podman ps | grep chsa/distcc | wc -l` -eq 0 ]; then \
	    if [ `podman ps -a | grep distccd | wc -l` -gt 0 ]; then \
	        echo "Removing the stalled copy..." ;\
	        podman rm distccd ;\
	    fi ;\
	    podman run -p 0.0.0.0:3632:3632 --name distccd -t -d chsa/distcc:latest ;\
	else \
	    echo "Already running..." ;\
	fi

stop:
	@if [ `podman ps | grep distccd | wc -l` -gt 0 ]; then \
	    podman stop distccd ;\
	    podman rm distccd ;\
	fi

restart:
	make stop
	make start

debug: build
	podman rm distccd ;\
	podman run -p 0.0.0.0:3632:3632 --name distccd -it chsa/distcc:latest /bin/bash

bash: build
	podman exec -it distccd /bin/bash

logs:
	podman logs distccd