2 # a "cheat" way to install docker on the controller
3 # can only be used if you have a connecting out to the internet
5 # Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
9 # a "cheat" way to install docker on the controller
10 # can only be used if you have a connecting out to the internet
12 # Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
17 IMAGENAME=odl_docker_image.tar
18 SOURCES=/etc/apt/sources.list
21 if [ "$#" -ne 2]; then
22 echo "Two args not provided, will not touch networking"
30 echo "delete old def route"
31 route delete default gw $1
32 echo "adding new def route"
33 route add default gw $2
35 echo " you should see a good nslookup now"
36 nslookup www.google.ca
38 # a "cheat" way to install docker on the controller
39 # can only be used if you have a connecting out to the internet
41 # Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
46 IMAGENAME=odl_docker_image.tar
47 SOURCES=/etc/apt/sources.list
50 if [ "$#" -ne 2]; then
51 echo "Two args not provided, will not touch networking"
59 echo "delete old def route"
60 route delete default gw $1
61 echo "adding new def route"
62 route add default gw $2
64 echo " you should see a good nslookup now"
65 nslookup www.google.ca
69 if egrep "mirrors.txt" $SOURCES
71 echo "Sources was already updated, not touching"
73 echo "adding the closests mirrors and docker mirror to the mix"
74 echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse" >> /etc/apt/sources.list
75 echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse" >> /etc/apt/sources.list
76 echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse" >> /etc/apt/sources.list
77 echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse" >> /etc/apt/sources.list
78 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
79 echo "deb https://get.docker.com/ubuntu docker main " > /etc/apt/sources.list.d/docker.list
84 echo "Installing Docker"
85 apt-get install -y lxc-docker
87 echo "Loading ODL Docker Image"
88 docker load -i $IMAGEPATH/$IMAGENAME