-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (37 loc) · 1.24 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
PORT_OPTS = -p 28080:8080
VOLUME_OPTS = -v $(PWD)/logs:/opt/tomcat/logs:rw
VERSION = 7.5.6
NAME_API = necbaas/api-server:$(VERSION)
NAME_CONSOLE = necbaas/console-server:$(VERSION)
NAME_BOTH = necbaas/api-console-server:$(VERSION)
PROXY = --build-arg http_proxy=$(http_proxy) --build-arg https_proxy=$(http_proxy)
.PHONY: api console both
all: api console both
#download:
# @./download.sh
api:
docker image build $(PROXY) -t $(NAME_API) -f Dockerfile.api .
console:
docker image build $(PROXY) -t $(NAME_CONSOLE) -f Dockerfile.console .
both:
docker image build $(PROXY) -t $(NAME_BOTH) -f Dockerfile.both .
rmi:
docker image rm $(NAME_API) $(NAME_CONSOLE) $(NAME_BOTH)
bash-api:
docker container run -it --rm $(NAME_API) /bin/bash
bash-console:
docker container run -it --rm $(NAME_CONSOLE) /bin/bash
bash-both:
docker container run -it --rm $(NAME_BOTH) /bin/bash
start-api:
docker container run -d $(PORT_OPTS) $(VOLUME_OPTS) $(NAME_API)
start-console:
docker container run -d $(PORT_OPTS) $(VOLUME_OPTS) $(NAME_CONSOLE)
start-both:
docker container run -d $(PORT_OPTS) $(VOLUME_OPTS) $(NAME_BOTH)
push-api:
docker image push $(NAME_API)
push-console:
docker image push $(NAME_CONSOLE)
push-both:
docker image push $(NAME_BOTH)