summaryrefslogtreecommitdiffstats
path: root/boot/robot_install.sh
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2017-05-09 12:20:28 -0400
committerMarco Platania <platania@research.att.com>2017-05-09 12:20:28 -0400
commit8a83578b5f007b4be348a969a74ad6c185c5b9e0 (patch)
tree4ff9f4296511963b7dd38a791922329c1f0537db /boot/robot_install.sh
parent6271e83bfe0a8225f63aa520fa03968a7453ddd0 (diff)
[UCA-10] Fix issue with MTU size in dockers
Change-Id: I19db615d3f5364d6b0894aabf5de60d192183595 Signed-off-by: Marco Platania <platania@research.att.com>
Diffstat (limited to 'boot/robot_install.sh')
-rw-r--r--boot/robot_install.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/boot/robot_install.sh b/boot/robot_install.sh
index 71b419c8..b5b73878 100644
--- a/boot/robot_install.sh
+++ b/boot/robot_install.sh
@@ -63,6 +63,20 @@ mkdir /opt/docker
curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
chmod +x /opt/docker/docker-compose
+# Set the MTU size of docker containers to the minimum MTU size supported by vNICs. OpenStack deployments may need to know the external DNS IP
+MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
+
+if [ -s /opt/config/external_dns.txt ]
+then
+ echo "DOCKER_OPTS=\"--dns $(cat /opt/config/external_dns.txt) --mtu=$MTU\"" >> /etc/default/docker
+else
+ echo "DOCKER_OPTS=\"--mtu=$MTU\"" >> /etc/default/docker
+fi
+
+cp /lib/systemd/system/docker.service /etc/systemd/system
+sed -i "/ExecStart/s/$/ --mtu=$MTU/g" /etc/systemd/system/docker.service
+service docker restart
+
# DNS IP address configuration
echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head
resolvconf -u