-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (43 loc) · 1.52 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
SHELL=/bin/sh
all:
quickstart: run_lagopus_vswitch run_pc1 run_pc2
kill_all: kill_lagopus_vswitch kill_pc1 kill_pc2
build_lagopus_vswitch: images/lagopus_vswitch
images/lagopus_vswitch: Dockerfile
{ docker build --no-cache -t lagopus-vswitch:ryu . && touch $@; }
rmi_lagopus_vswitch:
{ docker rmi lagopus-vswitch:ryu; rm images/lagopus_vswitch; }
run_lagopus_vswitch: containers/lagopus_vswitch
containers/lagopus_vswitch: build_lagopus_vswitch
{ \
C=$$(docker run -d -v $$(pwd)/samples:/src/samples -i -t lagopus-vswitch:ryu /src/samples/lagopus-vswitch.sh) && \
echo $$C > $@; \
sudo pipework br1 -i eth1 $$C 0.0.0.0/0 && \
sudo pipework br2 -i eth2 $$C 0.0.0.0/0; \
}
kill_lagopus_vswitch:
{ C=$$(cat containers/lagopus_vswitch) && docker kill $$C && rm containers/lagopus_vswitch; }
attach_lagopus_vswitch:
{ C=$$(cat containers/lagopus_vswitch) && docker attach $$C; }
run_pc1: containers/pc1
containers/pc1:
{ \
C=$$(docker run -d -n=false -i -t ubuntu:14.04 /bin/bash); \
echo $$C > $@; \
sudo pipework br1 -i eth0 $$C 169.254.0.1/24; \
}
kill_pc1:
{ C=$$(cat containers/pc1) && docker kill $$C && rm containers/pc1; }
attach_pc1:
{ C=$$(cat containers/pc1) && docker attach $$C; }
run_pc2: containers/pc2
containers/pc2:
{ \
C=$$(docker run -d -n=false -i -t ubuntu:14.04 /bin/bash); \
echo $$C > $@; \
sudo pipework br2 -i eth0 $$C 169.254.0.2/24; \
}
kill_pc2:
{ C=$$(cat containers/pc2) && docker kill $$C && rm containers/pc2; }
attach_pc2:
{ C=$$(cat containers/pc2) && docker attach $$C; }