-
Notifications
You must be signed in to change notification settings - Fork 11
/
Docker-Makefile
62 lines (40 loc) · 1.25 KB
/
Docker-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
# https://github.com/Miroka96/docker-makefile
NAME = hyrise/opossum
TAG = 1.0
VOLUME = ${PWD}
MOUNTPATH = /project
#LOCALPORT = 8080
#CONTAINERPORT = 80
# if you want a special image name, edit this
IMAGE = $(NAME):$(TAG)
# if you have no volume, delete the right part
VOLUMEMOUNTING = -v $(VOLUME):$(MOUNTPATH)
# if you publish no ports, delete the right part
PORTPUBLISHING = #-p $(LOCALPORT):$(CONTAINERPORT)
.PHONY: build test test-shell build-test deploy build-deploy undeploy redeploy build-redeploy clean-volume clean clean install-dependencies configure
build:
docker build -t $(IMAGE) .
build-nocache:
docker build -t $(IMAGE) --no-cache .
test:
docker run $(VOLUMEMOUNTING) $(PORTPUBLISHING) --rm $(IMAGE)
test-shell:
docker run -it $(VOLUMEMOUNTING) $(PORTPUBLISHING) --rm $(IMAGE) /bin/bash
build-test: build test
deploy:
docker run --detach --restart always --name=$(NAME) $(VOLUMEMOUNTING) $(PORTPUBLISHING) $(IMAGE)
build-deploy: build deploy
undeploy:
-docker stop $(NAME)
docker rm $(NAME)
redeploy: undeploy deploy
build-redeploy: build redeploy
clean-volume:
-docker volume rm $(VOLUME)
clean:
-docker rm $(NAME)
clean: clean-volume clean
install-dependencies:
echo No dependencies yet
configure:
echo No configuration yet