From e09cde6bc49e9c10d604446bbb56401a34c58710 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 2 Sep 2019 21:06:35 +0200 Subject: Make it work with nowadays system --- Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ba48592 --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +all: build +install: push + +.PHONY: rebuild build push start stop restart bash logs + +build: Dockerfile + docker build --tag chsa/distcc:latest . + +rebuild: Dockerfile + docker build --no-cache --tag chsa/distcc:latest . + +push: build + docker push chsa/distcc:latest + +start: build + if [ `docker ps | grep chsa/distcc | wc -l` -eq 0 ]; then \ + if [ `docker ps -a | grep distccd | wc -l` -gt 0 ]; then \ + echo "Removing the stalled copy..." ;\ + docker rm distccd ;\ + fi ;\ + docker run -p 0.0.0.0:3632:3632 --name distccd -t -d chsa/distcc:latest ;\ + else \ + echo "Already running..." ;\ + fi + +stop: + @if [ `docker ps | grep distccd | wc -l` -gt 0 ]; then \ + docker stop distccd ;\ + docker rm distccd ;\ + fi + +restart: + make stop + make start + +debug: build + docker rm distccd ;\ + docker run -p 0.0.0.0:3632:3632 --name distccd -it chsa/distcc:latest /bin/bash + +bash: build + docker exec -it distccd /bin/bash + +logs: + docker logs distccd + -- cgit v1.2.3