-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
55 lines (47 loc) · 852 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
NAME?=rosny
COMMAND?=bash
OPTIONS?=
.PHONY: all
all: stop build run
.PHONY: build
build:
docker build -t $(NAME) .
.PHONY: stop
stop:
-docker stop $(NAME)
-docker rm $(NAME)
.PHONY: run
run:
docker run --rm -dit \
$(OPTIONS) \
--net=host \
--ipc=host \
-v $(shell pwd):/workdir \
--name=$(NAME) \
$(NAME) \
$(COMMAND)
docker attach $(NAME)
.PHONY: run-x11
run-x11:
xhost local:root
docker run --rm -dit \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(HOME)/.Xauthority:/root/.Xauthority \
-e DISPLAY=$(shell echo ${DISPLAY}) \
$(OPTIONS) \
--net=host \
--ipc=host \
-v $(shell pwd):/workdir \
--name=$(NAME) \
$(NAME) \
$(COMMAND)
docker attach $(NAME)
.PHONY: attach
attach:
docker attach $(NAME)
.PHONY: logs
logs:
docker logs -f $(NAME)
.PHONY: exec
exec:
docker exec -it $(OPTIONS) $(NAME) $(COMMAND)