docker: container network for switch

This commit is contained in:
zhihui.ding
2023-04-04 23:59:03 +08:00
parent cda472b82c
commit fbfcf9ab39
11 changed files with 59 additions and 33 deletions

View File

@@ -1,32 +1,48 @@
version: "2.3"
services:
ovsdb-server:
confd:
restart: always
image: "openlan:latest"
privileged: true
entrypoint: ["/var/openlan/script/confd.sh", "start"]
# network_mode: "host"
volumes:
- /opt/openlan/confd:/var/openlan/confd
- /opt/openlan/etc/openlan:/etc/openlan
ports:
- 10000:10000
- 10002:10002
ovsdb-server:
restart: always
image: "openlan:latest"
privileged: true
entrypoint: ["/var/openlan/script/ovsdb-server.sh", "start"]
# network_mode: "host"
network_mode: service:confd
volumes:
- /opt/openlan/run/openvswitch:/run/openvswitch
- /opt/openlan/etc/openvswitch:/etc/openvswitch
depends_on:
- confd
ovs-vswitchd:
restart: always
image: "openlan:latest"
privileged: true
# network_mode: "host"
network_mode: service:confd
entrypoint: ["/var/openlan/script/ovs-vswitchd.sh", "start"]
volumes:
- /opt/openlan/run/openvswitch:/run/openvswitch
depends_on:
- confd
- ovsdb-server
confd:
image: "openlan:latest"
entrypoint: ["/var/openlan/script/confd.sh", "start"]
volumes:
- /opt/openlan/confd:/var/openlan/confd
- /opt/openlan/etc/openlan:/etc/openlan
switch:
restart: always
image: "openlan:latest"
privileged: true
# network_mode: "host"
network_mode: service:confd
entrypoint: ["/var/openlan/script/switch.sh", "start"]
ports:
- 10000:10000
- 10002:10002
volumes:
- /opt/openlan/confd:/var/openlan/confd
- /opt/openlan/run/openvswitch:/run/openvswitch