From 82d6b47ddc57a1f89afe5b087f8674c2ff2af340 Mon Sep 17 00:00:00 2001 From: Dmytro Dovbii Date: Thu, 15 Sep 2016 15:39:23 +0300 Subject: [PATCH] Fix DIB elements to allow docker use EnvironmentFile Closes-Bug: #1590070 Change-Id: I5cd7bcb9b6fc7356a9255e1e05a6a169a054ecf6 --- DockerStandaloneHost/elements/docker/install.d/56-docker | 8 +++++++- .../elements/docker/install.d/56-docker | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/DockerStandaloneHost/elements/docker/install.d/56-docker b/DockerStandaloneHost/elements/docker/install.d/56-docker index f5f8003..e756e31 100755 --- a/DockerStandaloneHost/elements/docker/install.d/56-docker +++ b/DockerStandaloneHost/elements/docker/install.d/56-docker @@ -5,4 +5,10 @@ set -eu install-packages curl curl -sSL https://get.docker.com/ | sh -echo 'DOCKER_OPTS="--bip=172.31.0.1/16 --fixed-cidr=172.31.0.0/16 --mtu=1450"' >> /etc/default/docker \ No newline at end of file +echo 'DOCKER_OPTS="--bip=172.31.0.1/16 --fixed-cidr=172.31.0.0/16 --mtu=1450"' >> /etc/default/docker +if [[ $(lsb_release -c -s) == 'jessie' ]]; then + # On debian docker ignores /etc/default/docker file + # Modifying docker.service to add reference to config file + sed -i '/Type=notify/a EnvironmentFile=-/etc/default/docker' /lib/systemd/system/docker.service + sed -i 's/fd:\/\//fd:\/\/ $DOCKER_OPTS/g' /lib/systemd/system/docker.service +fi diff --git a/Kubernetes/KubernetesCluster/elements/docker/install.d/56-docker b/Kubernetes/KubernetesCluster/elements/docker/install.d/56-docker index f5f8003..169e389 100755 --- a/Kubernetes/KubernetesCluster/elements/docker/install.d/56-docker +++ b/Kubernetes/KubernetesCluster/elements/docker/install.d/56-docker @@ -5,4 +5,11 @@ set -eu install-packages curl curl -sSL https://get.docker.com/ | sh -echo 'DOCKER_OPTS="--bip=172.31.0.1/16 --fixed-cidr=172.31.0.0/16 --mtu=1450"' >> /etc/default/docker \ No newline at end of file +echo 'DOCKER_OPTS="--bip=172.31.0.1/16 --fixed-cidr=172.31.0.0/16 --mtu=1450"' >> /etc/default/docker + +if [[ $(lsb_release -c -s) == 'jessie' ]]; then + # On debian docker ignores /etc/default/docker file + # Modifying docker.service to add reference to config file + sed -i '/Type=notify/a EnvironmentFile=-/etc/default/docker' /lib/systemd/system/docker.service + sed -i 's/fd:\/\//fd:\/\/ $DOCKER_OPTS/g' /lib/systemd/system/docker.service +fi