-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
85 lines (71 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
DOCKER_CACHE ?= 1
CILIUM_IPV4_RANGE ?= 10.8.0.0/16
CILIUM_ENABLED ?= 0
NOMAD_CLIENT_COUNT ?= 1
BASE_IMAGE = debian:bullseye-slim
CONSUL_VERSION ?= 1.18.1
NOMAD_VERSION ?= 1.7.6
HIND_VERSION = 0.2.0
ifeq ($(DOCKER_CACHE), 0)
docker-cache="--no-cache"
endif
.PHONY: up
up:
@HIND_VERSION=$(HIND_VERSION) \
CILIUM_ENABLED=$(CILIUM_ENABLED) \
CILIUM_IPV4_RANGE=$(CILIUM_IPV4_RANGE) \
NOMAD_CLIENT_COUNT=$(NOMAD_CLIENT_COUNT) \
./scripts/create.sh
.PHONY: down
down:
@./scripts/destroy.sh
.PHONY: build
build: consul nomad
.PHONY: consul
consul: consul-base consul-server consul-client
.PHONY: consul-base
consul-base:
@docker build $(docker-cache) \
--build-arg="BASE_IMAGE=$(BASE_IMAGE)" \
--build-arg="CONSUL_VERSION=$(CONSUL_VERSION)" \
-f ./images/consul-base/Dockerfile \
-t hind.consul:$(HIND_VERSION) \
./images/consul-base
.PHONY: consul-server
consul-server:
@docker build $(docker-cache) \
--build-arg="BASE_IMAGE=hind.consul:$(HIND_VERSION)" \
-f ./images/consul-server/Dockerfile \
-t hind.consul.server:$(HIND_VERSION) \
./images/consul-server
.PHONY: consul-client
consul-client:
@docker build $(docker-cache) \
--build-arg="BASE_IMAGE=hind.consul:$(HIND_VERSION)" \
-f ./images/consul-client/Dockerfile \
-t hind.consul.client:$(HIND_VERSION) \
./images/consul-client
.PHONY: nomad
nomad: nomad-base nomad-server nomad-client
.PHONY: nomad-base
nomad-base:
@docker build $(docker-cache) \
--build-arg="BASE_IMAGE=hind.consul.client:$(HIND_VERSION)" \
--build-arg="NOMAD_VERSION=$(NOMAD_VERSION)" \
-f ./images/nomad-base/Dockerfile \
-t hind.nomad:$(HIND_VERSION) \
./images/nomad-base
.PHONY: nomad-server
nomad-server:
@docker build $(docker-cache) \
--build-arg="BASE_IMAGE=hind.nomad:$(HIND_VERSION)" \
-f ./images/nomad-server/Dockerfile \
-t hind.nomad.server:$(HIND_VERSION) \
./images/nomad-server
.PHONY: nomad-client
nomad-client:
@docker build $(docker-cache) \
--build-arg="BASE_IMAGE=hind.nomad:$(HIND_VERSION)" \
-f ./images/nomad-client/Dockerfile \
-t hind.nomad.client:$(HIND_VERSION) \
./images/nomad-client