forked from forkkit/istio-cloud-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (29 loc) · 1.22 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
# override to push to a different registry or tag the image differently
REGISTRY ?= gcr.io/tetratelabs
TAG ?= v0.2
# Make sure we pick up any local overrides.
-include .makerc
build: istio-cloud-map
istio-cloud-map:
go build -o istio-cloud-map github.com/tetratelabs/istio-cloud-map/cmd/istio-cloud-map
chmod +x istio-cloud-map
run: istio-cloud-map
./istio-cloud-map serve --kube-config ~/.kube/config
build-static: docker/istio-cloud-map-static
docker/istio-cloud-map-static:
GOOS=linux go build \
-a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo \
-o docker/istio-cloud-map-static github.com/tetratelabs/istio-cloud-map/cmd/istio-cloud-map
chmod +x docker/istio-cloud-map-static
docker-build: docker/istio-cloud-map-static
docker build -t $(REGISTRY)/istio-cloud-map:$(TAG) docker/
docker-push: docker-build
docker push $(REGISTRY)/istio-cloud-map:$(TAG)
docker-run: docker-build
# local run, mounting kube config into the container and allowing it to use a host network to access the remote cluster
@docker run \
-v ~/.kube/config:/etc/istio-cloud-map/kube-config \
--network host \
$(REGISTRY)/istio-cloud-map:$(TAG) serve --kube-config /etc/istio-cloud-map/kube-config
clean:
rm -f istio-cloud-map