-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
64 lines (45 loc) · 1.58 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
dockerimage ?= moabitcoin/ig65m-pytorch
dockerfile ?= Dockerfile.cpu
srcdir ?= $(shell pwd)
datadir ?= $(shell pwd)
install:
@docker build -t $(dockerimage) -f $(dockerfile) .
i: install
update:
@docker build -t $(dockerimage) -f $(dockerfile) . --pull --no-cache
u: update
run:
@docker run \
--ipc=host \
-it \
--rm \
-v $(srcdir):/usr/src/app/ \
-v $(datadir):/data \
--entrypoint=/bin/bash $(dockerimage)
r: run
gpu:
@docker run \
--runtime=nvidia \
--ipc=host \
-it \
--rm \
-v $(srcdir):/usr/src/app/ \
-v $(datadir):/data \
--entrypoint=/bin/bash $(dockerimage)
g: gpu
webcam:
@docker run \
--ipc=host \
-it \
--rm \
-v $(srcdir):/usr/src/app/ \
-v $(datadir):/data \
--device=/dev/video0 \
--entrypoint=/bin/bash $(dockerimage)
w: webcam
publish:
@docker image save $(dockerimage) \
| pv -N "Publish $(dockerimage) to $(sshopts)" -s $(shell docker image inspect $(dockerimage) --format "{{.Size}}") \
| ssh $(sshopts) "docker image load"
p: publish
.PHONY: install i run r update u webcam w gpu g publish p