Files
magnum/contrib/drivers/dcos_centos_v1/image/docker/pre-install.d/20-configure-docker-service
fengbeihong 10e9132bb8 DIB elements to support dcos for magnum
This is a patch to build a centos image to support installing DC/OS as
a magnum coe.

Two elements are included: dcos and docker, only used to build a centos
image.

1. Element docker will install and configure docker in centos.
2. Element dcos will download dcos_generate_config.sh and do some
configurations for DC/OS.

Design spec in contrib/drivers/dcos_centos_v1/image/README.md.

Partially-Implements: blueprint mesos-dcos

Change-Id: I30fa4c102205aa2475b9491398c06da0d1e86f84
2016-12-06 10:10:36 +08:00

34 lines
923 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# Configure yum to use the Docker yum repo
sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
# Configure systemd to run the Docker Daemon with OverlayFS
# Manage Docker on CentOS with systemd.
# systemd handles starting Docker on boot and restarting it when it crashes.
#
# Docker 1.11.x will be installed, so issue for Docker 1.12.x on Centos7
# won't happen.
# https://github.com/docker/docker/issues/22847
# https://github.com/docker/docker/issues/25098
#
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/override.conf <<- 'EOF'
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon --storage-driver=overlay -H fd://
EOF