Fix the Ubuntu Xenial build gate

Ubuntu xenial use systemd service manager. Change the setup_Debian.sh
script to handle this.

Change-Id: I1f6487b73b1635e6dce0c68d3d7e1a158b427797
Partial-Bug: #1612887
This commit is contained in:
Jeffrey Zhang 2016-08-15 10:03:08 +08:00
parent 6ea99983fc
commit 5878757d26

View File

@ -51,17 +51,31 @@ function setup_disk {
# (SamYaple)TODO: Remove the path overriding
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
source /etc/lsb-release
# Setup Docker repo and add signing key
echo 'deb http://apt.dockerproject.org/repo ubuntu-trusty main' | sudo tee /etc/apt/sources.list.d/docker.list
echo "deb http://apt.dockerproject.org/repo ubuntu-${DISTRIB_CODENAME} main" | sudo tee /etc/apt/sources.list.d/docker.list
add_key
sudo apt-get update
sudo apt-get -y install --no-install-recommends docker-engine btrfs-tools
sudo service docker stop
setup_disk
echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker
sudo mount --make-shared /run
sudo service docker start
if [[ ${DISTRIB_CODENAME} == "trusty" ]]; then
echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker
sudo mount --make-shared /run
sudo service docker start
else
sudo mkdir /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/kolla.conf << EOF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --storage-driver btrfs
MountFlags=shared
EOF
sudo systemctl daemon-reload
sudo systemctl start docker
fi
sudo docker info