-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (49 loc) · 1.17 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
.PHONY: help
help:
@echo Usage: Building ARM docker image on x86 machines
@echo "\thelp Display this message"
@echo "\tinstall_qemu Install QEMU (for building ARM image on x86 machines)"
@echo "\tbuild Build docker image"
@echo "\trun Run the docker image"
@echo "\trunx11 Run the docker image with X11 forwarding"
ifndef file
file = Dockerfile
endif
ifndef image
image = raspbian:openvino
endif
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
.PHONY: install_qemu
install_qemu:
@/bin/bash qemu_install.sh
.PHONY: build
build:
@if [ ! -f "/usr/bin/qemu-arm-static" ]; \
then \
$(MAKE) install_qemu; \
fi;
@if [ ! -f "${file}" ]; \
then \
echo "Dockerfile {${file}} NOT FOUND!\n\n"; \
exit 1; \
fi;
@echo Building docker image...
@docker build -t ${image} -f ${file} .
.PHONY: run
run:
@docker run --privileged -v /dev:/dev -it --rm ${image}
.PHONY: runx11
runx11:
@touch ${XAUTH}
@xauth nlist ${DISPLAY} | sed 's/^..../ffff/' | xauth -f ${XAUTH} nmerge -
@xhost + local:docker
@docker run --privileged \
-v /dev:/dev \
-v ${XSOCK}:${XSOCK} \
-v ${XAUTH}:${XAUTH} \
-e XAUTH=${XAUTH} \
-e DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-it --rm \
${image}