-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile
47 lines (39 loc) · 1.29 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
# Version for docker images from git
RLA_VERSION := $(shell git describe --abbrev=0 --tags)
# Build both docker images
.PHONY: build-all
build-all: build build-gpu
# Build docker image. Application using GPU (nvidia docker needed)
.PHONY: build-gpu
build-gpu:
docker build --file Dockerfile.gpu -t lizaalert/lacmus:$(RLA_VERSION)-gpu .
# Build docker image. Application using CPU
.PHONY: build
build:
docker build -t lizaalert/lacmus:$(RLA_VERSION) .
# Build and run docker image. Application using CPU
.PHONY: run
run: build
docker run --rm \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$(DISPLAY) \
--workdir=$(pwd) \
--volume="/home/$(USER):/home/$(USER)" \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
lizaalert/lacmus:$(RLA_VERSION)
# Build and run docker image. Application using GPU
run-gpu: build-gpu
docker run --rm \
--runtime=nvidia \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$(DISPLAY) \
--workdir=$(pwd) \
--volume="/home/$(USER):/home/$(USER)" \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
lizaalert/lacmus:$(RLA_VERSION)-gpu