Skip to content

Commit 7bfc5e3

Browse files
committed
implement docker-compose test-bench
1 parent 0550fc2 commit 7bfc5e3

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM zlim/bcc
2+
3+
ADD ./udplb /usr/bin/udplb
4+
5+
ENTRYPOINT [ "/usr/bin/udplb" ]

config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
- key:
2-
address: 127.0.0.1
2+
address: 10.123.0.10
33
port: 8125
44
upstream:
5-
- address: 172.17.0.2
5+
- address: target_one
66
port: 8125
77
tc_action: pass
8-
- address: 172.17.0.3
8+
- address: target_two
99
port: 8125
1010
tc_action: pass

docker-compose.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: "2"
2+
3+
services:
4+
udplb:
5+
build: .
6+
cap_add:
7+
- NET_ADMIN
8+
- SYS_ADMIN
9+
privileged: true
10+
volumes:
11+
- "/lib/modules:/lib/modules:ro"
12+
- "/usr/src:/usr/src:ro"
13+
- "/etc/localtime:/etc/localtime:ro"
14+
- "./config.yaml:/config.yaml"
15+
restart: always
16+
command: "-d -c /config.yaml -i eth0"
17+
networks:
18+
vpcbr:
19+
ipv4_address: 10.123.0.10
20+
21+
target_one:
22+
image: corfr/tcpdump
23+
command: -XX -eni eth0 udp port 8125
24+
networks:
25+
vpcbr:
26+
ipv4_address: 10.123.0.20
27+
28+
target_two:
29+
image: corfr/tcpdump
30+
command: -XX -eni eth0 udp port 8125
31+
networks:
32+
vpcbr:
33+
ipv4_address: 10.123.0.30
34+
35+
networks:
36+
vpcbr:
37+
driver: bridge
38+
ipam:
39+
config:
40+
- subnet: 10.123.0.0/24
41+
gateway: 10.123.0.1

0 commit comments

Comments
 (0)