From 2d72be31634b25cb43b4ec533b7cb02ffe066ce1 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 21 Jan 2016 21:37:20 -0500 Subject: [PATCH] create the bridge with a script --- docs/source/advanced/docker/run_xcat_in_docker.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/source/advanced/docker/run_xcat_in_docker.rst b/docs/source/advanced/docker/run_xcat_in_docker.rst index a2592b8b1..fa84e5ca2 100644 --- a/docs/source/advanced/docker/run_xcat_in_docker.rst +++ b/docs/source/advanced/docker/run_xcat_in_docker.rst @@ -35,14 +35,18 @@ Create a customized bridge on the Docker host **Docker containers** connect to the Docker host network via a network bridge. To run xCAT in Docker, you should create a customized bridge according to the cluster network plan, instead of the default bridge "docker0". -As an example, create a bridge "br0" and attach the network interface "eth0" to it :: +Since the commands to create the bridge will break the network connection on "eth0", you'd better create a script such as "mkbridge" to create the bridge instead of running the commands sequencially. As an example, create a bridge "br0" and attach the network interface "eth0" to it. :: + [root@dockerhost1 ~]# cat /tmp/mkbridge + #!/bin/bash brctl addbr br0 brctl setfd br0 0 - ip addr del dev eth0 10.5.106.1/24 + ip addr del dev eth0 10.5.106.5/24 brctl addif br0 eth0 ip link set br0 up - ip addr add dev br0 10.5.106.1/24 + ip addr add dev br0 10.5.106.5/24 + [root@dockerhost1 ~]# chmod +x /tmp/mkbridge + [root@dockerhost1 ~]# /tmp/mkbridge Pull the xCAT Docker image from DockerHub: