-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
70 lines (54 loc) · 2.04 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
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
#
# MPContainer makefile (for Linux, MacOS, WSL)
# https://www.gnu.org/software/make/manual/make.html
#
#
# vars
#
#regurl=docker.pkg.github.com/${GIT_UN}/mpcontainer
regurl=localhost:5000
#
# tasks
#
.PHONY: help build publish prune stop-all dev-reg dev-logs dev-down dev-up dev-vm
help:
@echo ""
@echo "--== MPContainer Makefile help ==--"
@echo ""
@echo "make dev-vm \t\t- starts vagrant vm"
@echo "make comp-up \t\t- start compose"
@echo "make comp-down \t\t- stop compose"
@echo "make comp-logs \t\t- show compose logs"
@echo "make stop-all \t\t- stop all containers by MPContainer tag"
@echo "make dev-reg \t\t- start registry container"
@echo ""
.DEFAULT_GOAL := help
dev-vm:
cd ./vagrant-dev-vm/ && vagrant up
comp-up:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --detach
docker ps
comp-down:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml down
comp-logs:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml logs
stop-all:
docker container stop $(docker ps --filter "label=mpcontainer.vendor=MPContainer" -aq)
# The Docker Registry 2.0 implementation for storing and distributing Docker images
# https://hub.docker.com/_/registry
dev-reg:
docker run -d -p 5000:5000 --restart always --name registry registry:2
prune:
docker system prune -af
build:
docker build -t ${regurl}/mpcontainer-mpd:latest -f src/mpd/Dockerfile ./src/mpd/
docker build -t ${regurl}/mpcontainer-shell:latest -f src/adminshell/Dockerfile ./src/adminshell/
docker build -t ${regurl}/mpcontainer-web:latest --build-arg builddate=$(date +'%Y-%m-%d') -f src/web/Dockerfile ./src/web/
docker build -t ${regurl}/mpcontainer-pyapp:latest -f src/pyapp/Dockerfile ./src/pyapp/
docker build -t ${regurl}/mpcontainer-frontend:latest -f src/haproxy/Dockerfile ./src/haproxy/
publish:
docker push ${regurl}/mpcontainer-mpd:latest
docker push ${regurl}/mpcontainer-shell:latest
docker push ${regurl}/mpcontainer-web:latest
docker push ${regurl}/mpcontainer-pyapp:latest
docker push ${regurl}/mpcontainer-frontend:latest