Skip to content

Commit 47a58eb

Browse files
committed
Merge pull request #44 from sachja/master
mount gopath and update script to use that
2 parents 6cf446c + e951c92 commit 47a58eb

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/Dockerhost.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ The outside docker containers act like physical hosts in our test and are connec
66
Prerequisites
77
-------------
88
The following needs to be installed on the host machine
9+
910
1. Docker
11+
1012
2. nsenter (Pls see https://github.com/jpetazzo/nsenter)
13+
1114
3. Bridge utils
1215
```
1316
apt-get install bridge-utils
@@ -20,7 +23,7 @@ Step to launch docker hosts are :
2023
CONTINV_NODES=2 make start-dockerdemo
2124
```
2225
23-
This will start CONTIV_NODES number of containers with docker image called ubuntu_netplugin which is just ubuntu image with docker, etcd and ovs installed.
26+
This will start CONTIV_NODES number of containers with docker image called ubuntu_netplugin which is just ubuntu image with docker, etcd and ovs installed. The $GOPATH directory is mounted in the docker host at /gopath directory.
2427
2528
Now start a shell within any of the "host containers" using following convenience wrapper around nsenter :
2629
```
@@ -47,7 +50,7 @@ Example for testing TwoHostMultiVlan you can do :
4750
2. Load the netplugin configuration
4851
```
4952
docker-sh netplugin-node1
50-
/netplugin/bin/netdcli -cfg /netplugin/examples/two_hosts_multiple_vlans_nets.json
53+
/gopath/bin/netdcli -cfg /gopath/src/githib.com/contiv/netplugin/examples/two_hosts_multiple_vlans_nets.json
5154
```
5255
5356
3. Launch container1 on host1

scripts/dockerhost/start-dockerhosts

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ then
1414
fi
1515
echo "Num nodes = "$num_nodes
1616

17-
netplugin_path=$(pwd)
18-
1917
# Create the docker image for hosts
2018
sudo docker build -t ubuntu_netplugin $scriptdir
2119

@@ -25,7 +23,7 @@ for i in `seq 1 $num_nodes`;
2523
do
2624
hostname="netplugin-node$i"
2725
echo "Starting $hostname"
28-
sudo docker run -d -i -t --name $hostname --privileged -v /var/lib/docker -v $netplugin_path:/netplugin ubuntu_netplugin bash -c "/netplugin/scripts/dockerhost/start-service.sh & bash"
26+
sudo docker run -d -i -t --name $hostname --privileged -v /var/lib/docker -v $GOPATH:/gopath ubuntu_netplugin bash -c "/gopath/src/github.com/contiv/netplugin/scripts/dockerhost/start-service.sh & bash"
2927
sudo nsenter -t $($scriptdir/docker-pid $hostname) -n hostname $hostname
3028
sudo ip link add $i-int type veth peer name $i-ext
3129
sudo brctl addif br-em1 $i-ext
@@ -60,6 +58,6 @@ for i in `seq 1 $num_nodes`;
6058
do
6159
hostname="netplugin-node$i"
6260
echo "Starting netplugin on $hostname"
63-
sudo docker exec $hostname /netplugin/bin/netplugin -host-label host$i &
61+
sudo docker exec $hostname /gopath/bin/netplugin -host-label host$i &
6462
done
6563

0 commit comments

Comments
 (0)