-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·57 lines (40 loc) · 1023 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
ENV =
NS = nvidia
VERSION ?= latest
REPO = digits
NAME = digits
INSTANCE = default
PORTS = -p 5000:5000
VOLUMES = -v /media/corey/Storage/dataset:/dataset
.PHONY: build push shell run start stop rm release
build:
docker build -t $(NS)/$(REPO):$(VERSION) .
push:
docker push $(NS)/$(REPO):$(VERSION)
shell:
#docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(NS)/$(REPO):$(VERSION) /bin/bash
docker run --name $(NAME) -it $(PORTS) $(VOLUMES) --entrypoint "/bin/bash" $(NS)/$(REPO):$(VERSION)
run:
-make stop
-make rm
docker run -it --name $(NAME) --restart always $(PORTS) $(VOLUMES) $(ENV) $(NS)/$(REPO):$(VERSION)
# run as a deamon
start:
docker run -d --restart always --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(NS)/$(REPO):$(VERSION)
stop:
docker stop $(NAME)
rm:
docker rm $(NAME)
debug:
make build
make run
attach:
docker exec -it $(NAME) /bin/bash
logs:
docker logs $(NAME)
release: build
make push -e VERSION=$(VERSION)
test:
make build;make run
default: build
default: build