summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@linuxfoundation.org>2017-11-06 18:13:14 -0800
committerJessica Wagantall <jwagantall@linuxfoundation.org>2017-11-06 18:26:09 -0800
commit4699475388163b9059baff857b41abb53732830c (patch)
tree9ee13b554d95c6360ad66f85f8af2ebf7d50cd35
parent2ce0705c6db1d9d0f0935b8c95f36b7812e3beb4 (diff)
Fix docker MTU settings
Set MTU settings to 1454 to accept https connection requests. This issue seems to be present since Docker 1.10.0 Change-Id: Ia113ffdb889fa86e91075ef4f36b3e1872c699f6 Issue-ID: CIMAN-118 Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
-rw-r--r--packer/provision/docker.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/packer/provision/docker.sh b/packer/provision/docker.sh
index 125cbd4c2..12ebfc045 100644
--- a/packer/provision/docker.sh
+++ b/packer/provision/docker.sh
@@ -29,6 +29,47 @@ EOL
groupadd docker
}
+ubuntu_docker_mtu_fix(){
+ echo "---> Fixing docker's mtu settings"
+ systemctl stop docker
+ cat <<EOL > /etc/systemd/system/docker.service
+[Unit]
+Description=Docker Application Container Engine
+Documentation=https://docs.docker.com
+After=network.target docker.socket
+Requires=docker.socket
+
+[Service]
+Type=notify
+# the default is not to use systemd for cgroups because the delegate issues still
+# exists and systemd currently does not support the cgroup feature set required
+# for containers run by docker
+ExecStart=
+ExecStart=/usr/bin/dockerd --mtu 1454 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
+ExecReload=/bin/kill -s HUP $MAINPID
+# Having non-zero Limit*s causes performance problems due to accounting overhead
+# in the kernel. We recommend using cgroups to do container-local accounting.
+LimitNOFILE=infinity
+LimitNPROC=infinity
+LimitCORE=infinity
+# Uncomment TasksMax if your systemd version supports it.
+# Only systemd 226 and above support this version.
+TasksMax=infinity
+TimeoutStartSec=0
+# set delegate yes so that systemd does not reset the cgroups of docker containers
+Delegate=yes
+# kill only the docker process, not all processes in the cgroup
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target
+EOL
+ systemctl start docker
+ echo "---> Checking MTU"
+ docker network inspect bridge
+ echo "---> MTU set to 1454"
+}
+
ubuntu_systems() {
# Assumes that python is already installed by basebuild
@@ -45,6 +86,9 @@ ubuntu_systems() {
# Install docker
apt install -y docker.io
+
+ # Fixing Docker MTU settings
+ ubuntu_docker_mtu_fix
}
all_systems() {