Fix DIB elements to allow docker use EnvironmentFile

Closes-Bug: #1590070
Change-Id: I5cd7bcb9b6fc7356a9255e1e05a6a169a054ecf6
This commit is contained in:
Dmytro Dovbii 2016-09-15 15:39:23 +03:00
parent 41ed47a183
commit 82d6b47ddc
2 changed files with 15 additions and 2 deletions

View File

@ -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
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

View File

@ -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
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