From 370736abb761df28ad497cf354ce7394d5b2e1cc Mon Sep 17 00:00:00 2001
From: Paul Bourke <paul.bourke@oracle.com>
Date: Thu, 2 Jul 2015 10:32:51 +0000
Subject: [PATCH] Update centos-source-base from symlink to a real layer

There are additional depedencies on top of the binary base that are
needed to build and install source components.

This commit moves the base image for source installs from a symlink to
it's own layer, and adds the dependencies that will be needed to install
keystone (more can be added as we add new components).

Partially-Implements: blueprint install-from-source

Change-Id: I56ef6eafb95530e975988dffb62606309dba274e
---
 docker/centos/source/base                  |  1 -
 docker/centos/source/base/Dockerfile       | 27 ++++++++++++++++++++++
 docker/centos/source/base/build            |  1 +
 docker/centos/source/base/kolla-common.sh  |  1 +
 docker/centos/source/base/service_hosts.sh |  1 +
 5 files changed, 30 insertions(+), 1 deletion(-)
 delete mode 120000 docker/centos/source/base
 create mode 100644 docker/centos/source/base/Dockerfile
 create mode 120000 docker/centos/source/base/build
 create mode 120000 docker/centos/source/base/kolla-common.sh
 create mode 120000 docker/centos/source/base/service_hosts.sh

diff --git a/docker/centos/source/base b/docker/centos/source/base
deleted file mode 120000
index ffa82d75b2..0000000000
--- a/docker/centos/source/base
+++ /dev/null
@@ -1 +0,0 @@
-../binary/base/
\ No newline at end of file
diff --git a/docker/centos/source/base/Dockerfile b/docker/centos/source/base/Dockerfile
new file mode 100644
index 0000000000..b8a741e0bd
--- /dev/null
+++ b/docker/centos/source/base/Dockerfile
@@ -0,0 +1,27 @@
+FROM centos
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+# Set up repositories
+# This repository provides all dependencies used by RDO OpenStack
+RUN yum install -y https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm
+# This repository provides latest packages built from trunk master into RPMs
+RUN curl http://trunk.rdoproject.org/centos70/current/delorean.repo -o /etc/yum.repos.d/delorean-current.repo
+# This repository provides crux which permits idempotent operation of RDO
+RUN curl https://copr.fedoraproject.org/coprs/sdake/crux/repo/epel-7/sdake-crux-epel-7.repo -o /etc/yum.repos.d/sdake-crux-epel-7.repo
+
+# Dependencies required for building/installing source components
+RUN yum install -y \
+    MySQL-python \
+    git \
+    python-pip \
+    python-devel \
+    gcc \
+    tar \
+    openssl-devel \
+    libffi-devel \
+  && yum clean all
+
+RUN pip install --upgrade pip
+
+RUN mkdir -p /opt/kolla
+COPY service_hosts.sh kolla-common.sh /opt/kolla/
diff --git a/docker/centos/source/base/build b/docker/centos/source/base/build
new file mode 120000
index 0000000000..8d652f7ee2
--- /dev/null
+++ b/docker/centos/source/base/build
@@ -0,0 +1 @@
+../../../../tools/build-docker-image
\ No newline at end of file
diff --git a/docker/centos/source/base/kolla-common.sh b/docker/centos/source/base/kolla-common.sh
new file mode 120000
index 0000000000..c265c62f7a
--- /dev/null
+++ b/docker/centos/source/base/kolla-common.sh
@@ -0,0 +1 @@
+../../../common/base/kolla-common.sh
\ No newline at end of file
diff --git a/docker/centos/source/base/service_hosts.sh b/docker/centos/source/base/service_hosts.sh
new file mode 120000
index 0000000000..06e0454405
--- /dev/null
+++ b/docker/centos/source/base/service_hosts.sh
@@ -0,0 +1 @@
+../../../common/base/service_hosts.sh
\ No newline at end of file