-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
36 lines (27 loc) · 823 Bytes
/
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
DIR = .
FILE = Dockerfile
IMAGE = cytopia/metrics-server-prom
TAG = latest
.PHONY: build rebuild test tag pull login push
build:
docker build -t $(IMAGE) -f $(DIR)/$(FILE) $(DIR)
rebuild:
docker build --no-cache -t $(IMAGE) -f $(DIR)/$(FILE) $(DIR)
test:
true
tag:
docker tag $(IMAGE) $(IMAGE):$(TAG)
login:
yes | docker login --username $(USER) --password $(PASS)
push:
ifndef TAG
docker push $(IMAGE)
else
docker push $(IMAGE):$(TAG)
endif
bash-enter:
docker run --rm --name $(subst /,-,$(IMAGE)) -it --entrypoint=bash -p 9100:9100 -v ${HOME}/.kube/config:/etc/kube/config:ro $(ARG) $(IMAGE)
run:
docker run --rm --name $(subst /,-,$(IMAGE)) -p 9100:9100 -v ${HOME}/.kube/config:/etc/kube/config:ro $(ARG) $(IMAGE)
exec:
docker exec -it $(shell docker ps -q --filter "name=$(subst /,-,$(IMAGE))") bash