aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-08-28 12:16:53 +0000
committerSam Yaple <sam@yaple.net>2015-08-28 13:33:50 +0000
commitcbd42ca6e90cca2ff4b84f5e4e46224e6455e8b2 (patch)
tree2e4256b6b7b8339da11b1d17250378596e61605b /docker
parent3b5380ade021c9884551f427441cbfc0122eb0f0 (diff)
downloadkolla-cbd42ca6e90cca2ff4b84f5e4e46224e6455e8b2.tar.gz
kolla-cbd42ca6e90cca2ff4b84f5e4e46224e6455e8b2.zip
Move docker_templates to docker dir
Updated build.py to reflect this change. Deprecate --template option and make it a noop. Change-Id: I7cd98d1ee684a4c64984a49597159868152683b2 Partially-Implements: blueprint remove-docker-dir
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/base/Dockerfile.j2236
-rw-r--r--docker/base/kolla-common.sh22
-rw-r--r--docker/base/mariadb.yum.repo5
-rw-r--r--docker/base/sources.list22
-rw-r--r--docker/ceilometer/ceilometer-alarm/Dockerfile.j218
-rw-r--r--docker/ceilometer/ceilometer-alarm/config-external.sh10
-rwxr-xr-xdocker/ceilometer/ceilometer-alarm/start.sh14
-rw-r--r--docker/ceilometer/ceilometer-api/Dockerfile.j218
-rw-r--r--docker/ceilometer/ceilometer-api/config-external.sh10
-rwxr-xr-xdocker/ceilometer/ceilometer-api/start.sh21
-rw-r--r--docker/ceilometer/ceilometer-base/Dockerfile.j221
-rw-r--r--docker/ceilometer/ceilometer-central/Dockerfile.j218
-rw-r--r--docker/ceilometer/ceilometer-central/config-external.sh10
-rwxr-xr-xdocker/ceilometer/ceilometer-central/start.sh14
-rw-r--r--docker/ceilometer/ceilometer-collector/Dockerfile.j218
-rw-r--r--docker/ceilometer/ceilometer-collector/config-external.sh10
-rwxr-xr-xdocker/ceilometer/ceilometer-collector/start.sh14
-rw-r--r--docker/ceilometer/ceilometer-compute/Dockerfile.j220
-rw-r--r--docker/ceilometer/ceilometer-compute/config-external.sh10
-rwxr-xr-xdocker/ceilometer/ceilometer-compute/start.sh14
-rw-r--r--docker/ceilometer/ceilometer-notification/Dockerfile.j218
-rw-r--r--docker/ceilometer/ceilometer-notification/config-external.sh10
-rwxr-xr-xdocker/ceilometer/ceilometer-notification/start.sh14
-rw-r--r--docker/cinder/cinder-api/Dockerfile.j218
-rw-r--r--docker/cinder/cinder-api/config-external.sh10
-rwxr-xr-xdocker/cinder/cinder-api/start.sh21
-rw-r--r--docker/cinder/cinder-backup/Dockerfile.j29
-rw-r--r--docker/cinder/cinder-backup/config-external.sh10
-rwxr-xr-xdocker/cinder/cinder-backup/start.sh14
-rw-r--r--docker/cinder/cinder-base/Dockerfile.j249
-rw-r--r--docker/cinder/cinder-scheduler/Dockerfile.j29
-rw-r--r--docker/cinder/cinder-scheduler/config-external.sh10
-rwxr-xr-xdocker/cinder/cinder-scheduler/start.sh14
-rw-r--r--docker/cinder/cinder-volume/Dockerfile.j219
-rwxr-xr-xdocker/cinder/cinder-volume/config-external.sh10
-rwxr-xr-xdocker/cinder/cinder-volume/start.sh14
-rw-r--r--docker/data/Dockerfile.j26
-rw-r--r--docker/designate/designate-api/Dockerfile.j219
-rw-r--r--docker/designate/designate-api/config-external.sh10
-rwxr-xr-xdocker/designate/designate-api/start.sh20
-rw-r--r--docker/designate/designate-backend-bind9/Dockerfile.j219
-rw-r--r--docker/designate/designate-backend-bind9/config-external.sh10
-rwxr-xr-xdocker/designate/designate-backend-bind9/start.sh13
-rw-r--r--docker/designate/designate-base/Dockerfile.j237
-rw-r--r--docker/designate/designate-central/Dockerfile.j219
-rw-r--r--docker/designate/designate-central/config-external.sh10
-rwxr-xr-xdocker/designate/designate-central/start.sh13
-rw-r--r--docker/designate/designate-mdns/Dockerfile.j218
-rw-r--r--docker/designate/designate-mdns/config-external.sh10
-rwxr-xr-xdocker/designate/designate-mdns/start.sh13
-rw-r--r--docker/designate/designate-poolmanager/Dockerfile.j221
-rw-r--r--docker/designate/designate-poolmanager/config-external.sh10
-rwxr-xr-xdocker/designate/designate-poolmanager/start.sh13
-rw-r--r--docker/designate/designate-sink/Dockerfile.j220
-rw-r--r--docker/designate/designate-sink/config-external.sh10
-rwxr-xr-xdocker/designate/designate-sink/start.sh13
-rw-r--r--docker/galera/Dockerfile.j242
-rw-r--r--docker/galera/config-external.sh11
-rwxr-xr-xdocker/galera/config-galera.sh37
-rwxr-xr-xdocker/galera/start.sh25
-rw-r--r--docker/glance/glance-api/Dockerfile.j29
-rwxr-xr-xdocker/glance/glance-api/config-external.sh10
-rwxr-xr-xdocker/glance/glance-api/start.sh20
-rw-r--r--docker/glance/glance-base/Dockerfile.j228
-rw-r--r--docker/glance/glance-registry/Dockerfile.j29
-rwxr-xr-xdocker/glance/glance-registry/config-external.sh10
-rwxr-xr-xdocker/glance/glance-registry/start.sh13
-rw-r--r--docker/gnocchi/gnocchi-api/Dockerfile.j221
-rw-r--r--docker/gnocchi/gnocchi-api/config-external.sh10
-rwxr-xr-xdocker/gnocchi/gnocchi-api/start.sh21
-rw-r--r--docker/gnocchi/gnocchi-base/Dockerfile.j225
-rw-r--r--docker/gnocchi/gnocchi-statsd/Dockerfile.j218
-rw-r--r--docker/gnocchi/gnocchi-statsd/config-external.sh10
-rwxr-xr-xdocker/gnocchi/gnocchi-statsd/start.sh14
-rwxr-xr-xdocker/haproxy/Dockerfile.j227
-rw-r--r--docker/haproxy/config-external.sh10
-rwxr-xr-xdocker/haproxy/ensure_latest_config.sh12
-rwxr-xr-xdocker/haproxy/start.sh20
-rw-r--r--docker/heat/heat-api-cfn/Dockerfile.j225
-rw-r--r--docker/heat/heat-api-cfn/config-external.sh10
-rwxr-xr-xdocker/heat/heat-api-cfn/start.sh13
-rw-r--r--docker/heat/heat-api/Dockerfile.j225
-rw-r--r--docker/heat/heat-api/config-external.sh10
-rwxr-xr-xdocker/heat/heat-api/start.sh13
-rw-r--r--docker/heat/heat-base/Dockerfile.j227
-rw-r--r--docker/heat/heat-engine/Dockerfile.j228
-rw-r--r--docker/heat/heat-engine/config-external.sh10
-rwxr-xr-xdocker/heat/heat-engine/start.sh20
-rw-r--r--docker/horizon/Dockerfile.j258
-rw-r--r--docker/horizon/config-external.sh25
-rwxr-xr-xdocker/horizon/start.sh23
-rw-r--r--docker/ironic/ironic-api/Dockerfile.j219
-rw-r--r--docker/ironic/ironic-api/config-external.sh11
-rwxr-xr-xdocker/ironic/ironic-api/start.sh10
-rw-r--r--docker/ironic/ironic-base/Dockerfile.j233
-rw-r--r--docker/ironic/ironic-conductor/Dockerfile.j219
-rw-r--r--docker/ironic/ironic-conductor/config-external.sh11
-rwxr-xr-xdocker/ironic/ironic-conductor/start.sh10
-rw-r--r--docker/ironic/ironic-discoverd/Dockerfile.j219
-rw-r--r--docker/ironic/ironic-discoverd/config-external.sh11
-rwxr-xr-xdocker/ironic/ironic-discoverd/start.sh10
-rw-r--r--docker/keepalived/Dockerfile.j226
-rwxr-xr-xdocker/keepalived/check_alive.sh6
-rwxr-xr-xdocker/keepalived/config-external.sh10
-rwxr-xr-xdocker/keepalived/start.sh20
-rw-r--r--docker/keystone/Dockerfile.j271
-rw-r--r--docker/keystone/config-external.sh25
-rwxr-xr-xdocker/keystone/start.sh48
-rw-r--r--docker/kolla-ansible/Dockerfile.j238
-rw-r--r--docker/kolla-ansible/kolla_keystone_service.py84
-rw-r--r--docker/kolla-ansible/kolla_keystone_user.py83
-rw-r--r--docker/magnum/magnum-api/Dockerfile.j219
-rw-r--r--docker/magnum/magnum-api/config-external.sh10
-rwxr-xr-xdocker/magnum/magnum-api/start.sh20
-rw-r--r--docker/magnum/magnum-base/Dockerfile.j229
-rw-r--r--docker/magnum/magnum-conductor/Dockerfile.j223
-rw-r--r--docker/magnum/magnum-conductor/config-external.sh10
-rwxr-xr-xdocker/magnum/magnum-conductor/start.sh14
-rw-r--r--docker/memcached/Dockerfile.j221
-rw-r--r--docker/memcached/config-external.sh10
-rwxr-xr-xdocker/memcached/start.sh16
-rw-r--r--docker/mongodb/Dockerfile.j225
-rw-r--r--docker/murano/murano-api/Dockerfile.j29
-rw-r--r--docker/murano/murano-api/config-external.sh10
-rwxr-xr-xdocker/murano/murano-api/start.sh20
-rw-r--r--docker/murano/murano-base/Dockerfile.j219
-rw-r--r--docker/murano/murano-engine/Dockerfile.j29
-rw-r--r--docker/murano/murano-engine/config-external.sh10
-rwxr-xr-xdocker/murano/murano-engine/start.sh13
-rw-r--r--docker/neutron/neutron-agents/Dockerfile.j235
l---------docker/neutron/neutron-agents/fwaas_driver.ini1
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh13
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-dhcp-agent/start.sh37
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-l3-agent/config-external.sh23
-rw-r--r--docker/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini3
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-l3-agent/start.sh37
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-metadata-agent/config-external.sh13
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-metadata-agent/start.sh37
-rw-r--r--docker/neutron/neutron-agents/supervisord.conf40
-rw-r--r--docker/neutron/neutron-base/Dockerfile.j247
-rw-r--r--docker/neutron/neutron-base/config-sudoers.sh12
-rwxr-xr-xdocker/neutron/neutron-base/ip_wrapper.py66
-rw-r--r--docker/neutron/neutron-linuxbridge-agent/Dockerfile.j228
-rwxr-xr-xdocker/neutron/neutron-linuxbridge-agent/config-external.sh20
-rwxr-xr-xdocker/neutron/neutron-linuxbridge-agent/start.sh14
-rw-r--r--docker/neutron/neutron-openvswitch-agent/Dockerfile.j232
-rwxr-xr-xdocker/neutron/neutron-openvswitch-agent/config-external.sh20
-rwxr-xr-xdocker/neutron/neutron-openvswitch-agent/start.sh14
-rw-r--r--docker/neutron/neutron-server/Dockerfile.j231
-rwxr-xr-xdocker/neutron/neutron-server/config-external.sh20
-rwxr-xr-xdocker/neutron/neutron-server/start.sh20
-rw-r--r--docker/nova/nova-api/Dockerfile.j218
-rwxr-xr-xdocker/nova/nova-api/config-external.sh10
-rwxr-xr-xdocker/nova/nova-api/start.sh20
-rw-r--r--docker/nova/nova-base/Dockerfile.j250
-rw-r--r--docker/nova/nova-compute/Dockerfile.j234
-rwxr-xr-xdocker/nova/nova-compute/config-external.sh10
-rwxr-xr-xdocker/nova/nova-compute/start.sh13
-rw-r--r--docker/nova/nova-conductor/Dockerfile.j219
-rwxr-xr-xdocker/nova/nova-conductor/config-external.sh10
-rwxr-xr-xdocker/nova/nova-conductor/start.sh13
-rw-r--r--docker/nova/nova-consoleauth/Dockerfile.j218
-rwxr-xr-xdocker/nova/nova-consoleauth/config-external.sh10
-rwxr-xr-xdocker/nova/nova-consoleauth/start.sh13
-rw-r--r--docker/nova/nova-libvirt/Dockerfile.j232
-rwxr-xr-xdocker/nova/nova-libvirt/config-external.sh10
-rwxr-xr-xdocker/nova/nova-libvirt/start.sh20
-rw-r--r--docker/nova/nova-network/Dockerfile.j228
-rwxr-xr-xdocker/nova/nova-network/config-external.sh10
-rwxr-xr-xdocker/nova/nova-network/start.sh13
-rw-r--r--docker/nova/nova-novncproxy/Dockerfile.j234
-rwxr-xr-xdocker/nova/nova-novncproxy/config-external.sh10
-rwxr-xr-xdocker/nova/nova-novncproxy/start.sh13
-rw-r--r--docker/nova/nova-scheduler/Dockerfile.j218
-rwxr-xr-xdocker/nova/nova-scheduler/config-external.sh10
-rwxr-xr-xdocker/nova/nova-scheduler/start.sh13
-rw-r--r--docker/openvswitch/ovs-base/Dockerfile.j222
-rw-r--r--docker/openvswitch/ovs-db-server/Dockerfile.j29
-rw-r--r--docker/openvswitch/ovs-db-server/config-external.sh3
-rwxr-xr-xdocker/openvswitch/ovs-db-server/start.sh25
-rw-r--r--docker/openvswitch/ovs-vswitchd/Dockerfile.j29
-rw-r--r--docker/openvswitch/ovs-vswitchd/config-external.sh3
-rwxr-xr-xdocker/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh17
-rwxr-xr-xdocker/openvswitch/ovs-vswitchd/start.sh19
-rw-r--r--docker/rabbitmq/Dockerfile.j227
-rw-r--r--docker/rabbitmq/config-external.sh19
-rw-r--r--docker/rabbitmq/config-rabbit.sh7
-rwxr-xr-xdocker/rabbitmq/start.sh23
-rw-r--r--docker/swift/swift-account-server/Dockerfile.j219
-rw-r--r--docker/swift/swift-account-server/config-external.sh19
-rwxr-xr-xdocker/swift/swift-account-server/start.sh16
-rw-r--r--docker/swift/swift-base/Dockerfile.j229
-rw-r--r--docker/swift/swift-base/build-swift-ring.py93
-rwxr-xr-xdocker/swift/swift-base/config-swift.sh3
-rw-r--r--docker/swift/swift-container-server/Dockerfile.j219
-rw-r--r--docker/swift/swift-container-server/config-external.sh21
-rwxr-xr-xdocker/swift/swift-container-server/start.sh16
-rw-r--r--docker/swift/swift-object-auditor/Dockerfile.j29
-rw-r--r--docker/swift/swift-object-auditor/config-external.sh18
-rwxr-xr-xdocker/swift/swift-object-auditor/start.sh16
-rw-r--r--docker/swift/swift-object-base/Dockerfile.j214
-rw-r--r--docker/swift/swift-object-base/config-swift-object.sh72
-rw-r--r--docker/swift/swift-object-expirer/Dockerfile.j220
-rw-r--r--docker/swift/swift-object-expirer/config-external.sh18
-rwxr-xr-xdocker/swift/swift-object-expirer/start.sh16
-rw-r--r--docker/swift/swift-object-replicator/Dockerfile.j29
-rw-r--r--docker/swift/swift-object-replicator/config-external.sh18
-rwxr-xr-xdocker/swift/swift-object-replicator/start.sh16
-rw-r--r--docker/swift/swift-object-server/Dockerfile.j29
-rw-r--r--docker/swift/swift-object-server/config-external.sh27
-rwxr-xr-xdocker/swift/swift-object-server/start.sh16
-rw-r--r--docker/swift/swift-object-updater/Dockerfile.j29
-rw-r--r--docker/swift/swift-object-updater/config-external.sh18
-rwxr-xr-xdocker/swift/swift-object-updater/start.sh16
-rw-r--r--docker/swift/swift-proxy-server/Dockerfile.j216
-rwxr-xr-xdocker/swift/swift-proxy-server/config-external.sh33
-rwxr-xr-xdocker/swift/swift-proxy-server/start.sh16
-rw-r--r--docker/zaqar/Dockerfile.j232
-rw-r--r--docker/zaqar/config-external.sh10
-rwxr-xr-xdocker/zaqar/start.sh21
220 files changed, 4497 insertions, 0 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
new file mode 100755
index 000000000..b3b0c776a
--- /dev/null
+++ b/docker/base/Dockerfile.j2
@@ -0,0 +1,236 @@
+FROM {{ base_distro }}:{{ base_distro_tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{{ include_header }}
+
+ENV KOLLA_BASE_DISTRO {{ base_distro }}
+ENV KOLLA_INSTALL_TYPE {{ install_type }}
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+# Turns on galera repos throughout the build
+COPY mariadb.yum.repo /etc/yum.repos.d/MariaDB.repo
+
+RUN yum install -y http://www.percona.com/redir/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm \
+ && sed -i 's|$releasever|centos/latest|g' /etc/yum.repos.d/percona-release.repo
+
+ {% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'oraclelinux'] %}
+
+# 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/centos7/current/delorean.repo -o /etc/yum.repos.d/delorean-current.repo
+
+# This repository turns off auth in PAM so we can operate on Ubuntu 14.04
+RUN curl https://copr.fedoraproject.org/coprs/sdake/pam.noaudit/repo/epel-7/sdake-pam.noaudit-epel-7.repo -o /etc/yum.repos.d/sdake-pam.noaudit-epel-7.repo
+
+{% if base_distro == 'centos' %}
+# CentOS 7.1 workaround for conflicting packages with libvirt
+RUN rpm -e --nodeps systemd-container systemd-container-libs \
+ && rpm -e --nodeps yum-plugin-fastestmirror \
+ && yum -d 10 -y install systemd systemd-libs systemd-devel \
+ && yum clean all
+{% endif %}
+
+{% if base_distro == 'oraclelinux' %}
+RUN yum install -y \
+ yum-utils \
+ https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
+ && yum clean all
+RUN yum-config-manager --enable ol7_optional_latest ol7_addons
+{% endif %}
+
+ # Endif for base_distro centos/oraclelinux
+ {% elif base_distro == 'fedora' %}
+
+# Set up repositories
+RUN yum install -y https://rdo.fedorapeople.org/rdo-release.rpm \
+ && yum -y install dnf dnf-plugins-core \
+ && yum clean all \
+ && dnf copr enable -y sdake/pam.noaudit
+
+ # Endif for base_distro fedora
+ {% endif %}
+
+# Update packages
+RUN yum update -y \
+ && yum install -y epel-release \
+ && yum clean all
+
+# Install base packages
+RUN yum install -y \
+ git \
+ iproute \
+ mariadb-libs \
+ openssl \
+ openstack-utils \
+ pyparsing \
+ python-alembic \
+ python-amqp \
+ python-amqplib \
+ python-anyjson \
+ python-boto \
+ python-cheetah \
+ python-cliff \
+ python-cmd2 \
+ python-croniter \
+ python-crypto \
+ python-d2to1 \
+ python-docutils \
+ python-dogpile-cache \
+ python-dogpile-core \
+ python-empy \
+ python-eventlet \
+ python-flask \
+ python-futures \
+ python-greenlet \
+ python-httplib2 \
+ python-iso8601 \
+ python-itsdangerous \
+ python-jinja2 \
+ python-jsonpatch \
+ python-jsonpath-rw \
+ python-jsonpointer \
+ python-jsonschema \
+ python-keyring \
+ python-kombu \
+ python-ldap \
+ python-lesscpy \
+ python-lockfile \
+ python-lxml \
+ python-markdown \
+ python-memcached \
+ python-migrate \
+ python-msgpack \
+ python-netifaces \
+ python-networkx \
+ python-oauthlib \
+ python-oslo-config \
+ python-oslo-messaging \
+ python-oslo-rootwrap \
+ python-oslo-policy \
+ python-paramiko \
+ python-passlib \
+ python-paste-deploy \
+ python-pbr \
+ python-pecan \
+ python-pip \
+ python-ply \
+ python-prettytable \
+ python-psutil \
+ python-pycadf \
+ python-pygments \
+ python-pymongo \
+ python-qpid \
+ python-repoze-lru \
+ python-requests \
+ python-routes \
+ python-simplegeneric \
+ python-simplejson \
+ python-singledispatch \
+ python-six \
+ python-sqlalchemy \
+ python-stevedore \
+ python-taskflow \
+ python-versiontools \
+ python-warlock \
+ python-webob \
+ python-websockify \
+ python-webtest \
+ python-werkzeug \
+ python-wsme \
+ && yum clean all
+
+# TODO(inc0): when oslo_service lands in delorean, change pip to yum
+# necessary until https://bugzilla.redhat.com/show_bug.cgi?id=1229477 is fixed
+
+# This is dirty like zebra. This works around a bug in Ubuntu 14.04 LTS. The
+# --net=host option does not work on ubuntu 14.04 because of a kernel bug. One
+# workaround is to buid pam without authentication.
+# See:
+# https://registry.hub.docker.com/u/sequenceiq/pam/
+#
+RUN rpm -e --nodeps pam \
+ && yum -y install pam+noaudit \
+ && yum clean all
+# End dirty like zebra
+
+ # Endif for install_type binary
+ {% elif install_type == 'source' %}
+
+# Update packages
+RUN yum update -y \
+ && yum install -y \
+ epel-release \
+ gcc \
+ gcc-c++ \
+ git \
+ libffi-devel \
+ libxml2-devel \
+ libxslt-devel \
+ mariadb-devel \
+ mysql-devel \
+ MySQL-python \
+ openldap-devel \
+ openssl \
+ openssl-devel \
+ postgresql \
+ postgresql-devel \
+ python-devel \
+ python-oslo-policy \
+ sqlite-devel \
+ tar \
+ && yum clean all
+
+ # Endif for install_type source
+ {% endif %}
+
+# Endif for base_distro centos,fedora,oraclelinux
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+# This will prevent questions from being asked during the install
+ENV DEBIAN_FRONTEND noninteractive
+
+COPY sources.list /etc/apt/
+
+RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 199369E5404BD5FC7D2FE43BCBCB082A1BB943DB \
+ && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 391A9AA2147192839E9DB0315EDB1B62EC4926EA \
+ && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com F78372A06FF50C80464FC1B4F7B8CEA6056E8E56 \
+ && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \
+ && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 7D5C473EB80C00FC133071068A6844A29F68104E \
+ && apt-get update \
+ && apt-get upgrade -y \
+ && apt-get dist-upgrade -y \
+ && apt-get install -y --no-install-recommends \
+ curl \
+ ca-certificates \
+ build-essential \
+ python-dev \
+ libssl-dev \
+ python-mysqldb \
+ libmariadbclient-dev \
+ libxslt1-dev \
+ libffi-dev \
+ libyaml-dev \
+ pkg-config \
+ && apt-get clean \
+ && sed -i "s|'purelib': '\$base/local/lib/python\$py_version_short/dist-packages',|'purelib': '\$base/lib/python\$py_version_short/dist-packages',|;s|'platlib': '\$platbase/local/lib/python\$py_version_short/dist-packages',|'platlib': '\$platbase/lib/python\$py_version_short/dist-packages',|;s|'headers': '\$base/local/include/python\$py_version_short/\$dist_name',|'headers': '\$base/include/python\$py_version_short/\$dist_name',|;s|'scripts': '\$base/local/bin',|'scripts': '\$base/bin',|;s|'data' : '\$base/local',|'data' : '\$base',|" /usr/lib/python2.7/distutils/command/install.py \
+ && rm -rf /usr/lib/python2.7/site-packages \
+ && ln -s dist-packages /usr/lib/python2.7/site-packages
+
+# Endif for base_distro ubuntu,debian
+{% endif %}
+
+{% if install_type == 'source' %}
+
+RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
+ && python get-pip.py \
+ && rm get-pip.py
+
+# Endif for install_type source
+{% endif %}
+
+COPY kolla-common.sh /opt/kolla/
diff --git a/docker/base/kolla-common.sh b/docker/base/kolla-common.sh
new file mode 100644
index 000000000..cc960ca24
--- /dev/null
+++ b/docker/base/kolla-common.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set_configs() {
+ case $KOLLA_CONFIG_STRATEGY in
+ COPY_ALWAYS)
+ source /opt/kolla/config-external.sh
+ ;;
+ COPY_ONCE)
+ if [[ -f /configured ]]; then
+ echo 'INFO - This container has already been configured; Refusing to copy new configs'
+ else
+ source /opt/kolla/config-external.sh
+ touch /configured
+ fi
+ ;;
+
+ *)
+ echo '$KOLLA_CONFIG_STRATEGY is not set properly'
+ exit 1
+ ;;
+ esac
+}
diff --git a/docker/base/mariadb.yum.repo b/docker/base/mariadb.yum.repo
new file mode 100644
index 000000000..564ce3f0e
--- /dev/null
+++ b/docker/base/mariadb.yum.repo
@@ -0,0 +1,5 @@
+[mariadb]
+name = MariaDB
+baseurl = http://yum.mariadb.org/10.0/centos7-amd64
+gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
+gpgcheck=1
diff --git a/docker/base/sources.list b/docker/base/sources.list
new file mode 100644
index 000000000..ccb6f8d25
--- /dev/null
+++ b/docker/base/sources.list
@@ -0,0 +1,22 @@
+# Default repos
+deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
+deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
+deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
+
+# Backports have a lower priority and must be explictly installed to be used
+deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
+
+# TODO(SamYaple): Switch this to the Liberty repo as soon as the update packages
+# and actually start signing them.
+# We need to add the Kilo repo for the updated packages they provide. The main
+# ones are qemu, libvirt, and openvswitch.
+deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/kilo main
+
+# MariaDB 10.0 repo
+deb http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty main
+
+# Percona repo (for xtrabackup)
+deb http://repo.percona.com/apt trusty main
+
+# RabbitMQ repo. Despite the name, the 'testing' repo is the stable repo.
+deb http://www.rabbitmq.com/debian/ testing main
diff --git a/docker/ceilometer/ceilometer-alarm/Dockerfile.j2 b/docker/ceilometer/ceilometer-alarm/Dockerfile.j2
new file mode 100644
index 000000000..aa62562ac
--- /dev/null
+++ b/docker/ceilometer/ceilometer-alarm/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ceilometer-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y openstack-ceilometer-alarm \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-alarm/config-external.sh b/docker/ceilometer/ceilometer-alarm/config-external.sh
new file mode 100644
index 000000000..2835bd5aa
--- /dev/null
+++ b/docker/ceilometer/ceilometer-alarm/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/ceilometer/ceilometer.conf"
+TARGET="/etc/ceilometer/ceilometer.conf"
+OWNER="ceilometer"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ceilometer/ceilometer-alarm/start.sh b/docker/ceilometer/ceilometer-alarm/start.sh
new file mode 100755
index 000000000..ab5501b23
--- /dev/null
+++ b/docker/ceilometer/ceilometer-alarm/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/ceilometer-alarm"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-api/Dockerfile.j2 b/docker/ceilometer/ceilometer-api/Dockerfile.j2
new file mode 100644
index 000000000..805e5e8eb
--- /dev/null
+++ b/docker/ceilometer/ceilometer-api/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ceilometer-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y openstack-ceilometer-api \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-api/config-external.sh b/docker/ceilometer/ceilometer-api/config-external.sh
new file mode 100644
index 000000000..2835bd5aa
--- /dev/null
+++ b/docker/ceilometer/ceilometer-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/ceilometer/ceilometer.conf"
+TARGET="/etc/ceilometer/ceilometer.conf"
+OWNER="ceilometer"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ceilometer/ceilometer-api/start.sh b/docker/ceilometer/ceilometer-api/start.sh
new file mode 100755
index 000000000..0f660e025
--- /dev/null
+++ b/docker/ceilometer/ceilometer-api/start.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/ceilometer-api"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Config-internal script exec out of this function, it does not return here.
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "ceilometer-manage db_sync" ceilometer
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-base/Dockerfile.j2 b/docker/ceilometer/ceilometer-base/Dockerfile.j2
new file mode 100644
index 000000000..92a3b70d9
--- /dev/null
+++ b/docker/ceilometer/ceilometer-base/Dockerfile.j2
@@ -0,0 +1,21 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+
+ADD ceilometer.tar /
+RUN ln -s /ceilometer-* ceilometer \
+ && useradd --user-group ceilometer \
+ && pip --no-cache-dir install /ceilometer \
+ && mkdir -p /etc/ceilometer /var/log/ceilometer /home/ceilometer \
+ && cp -r /ceilometer/etc/* /etc/ceilometer/ \
+ && chown -R ceilometer: /etc/ceilometer /var/log/ceilometer /home/ceilometer
+
+{% endif %}
diff --git a/docker/ceilometer/ceilometer-central/Dockerfile.j2 b/docker/ceilometer/ceilometer-central/Dockerfile.j2
new file mode 100644
index 000000000..b45c5fac3
--- /dev/null
+++ b/docker/ceilometer/ceilometer-central/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ceilometer-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y openstack-ceilometer-central \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-central/config-external.sh b/docker/ceilometer/ceilometer-central/config-external.sh
new file mode 100644
index 000000000..2835bd5aa
--- /dev/null
+++ b/docker/ceilometer/ceilometer-central/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/ceilometer/ceilometer.conf"
+TARGET="/etc/ceilometer/ceilometer.conf"
+OWNER="ceilometer"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ceilometer/ceilometer-central/start.sh b/docker/ceilometer/ceilometer-central/start.sh
new file mode 100755
index 000000000..f2980a4d5
--- /dev/null
+++ b/docker/ceilometer/ceilometer-central/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/ceilometer-agent-central"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-collector/Dockerfile.j2 b/docker/ceilometer/ceilometer-collector/Dockerfile.j2
new file mode 100644
index 000000000..6f425e855
--- /dev/null
+++ b/docker/ceilometer/ceilometer-collector/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ceilometer-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y openstack-ceilometer-collector \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-collector/config-external.sh b/docker/ceilometer/ceilometer-collector/config-external.sh
new file mode 100644
index 000000000..2835bd5aa
--- /dev/null
+++ b/docker/ceilometer/ceilometer-collector/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/ceilometer/ceilometer.conf"
+TARGET="/etc/ceilometer/ceilometer.conf"
+OWNER="ceilometer"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ceilometer/ceilometer-collector/start.sh b/docker/ceilometer/ceilometer-collector/start.sh
new file mode 100755
index 000000000..3a59c17d1
--- /dev/null
+++ b/docker/ceilometer/ceilometer-collector/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/ceilometer-collector"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-compute/Dockerfile.j2 b/docker/ceilometer/ceilometer-compute/Dockerfile.j2
new file mode 100644
index 000000000..0487af710
--- /dev/null
+++ b/docker/ceilometer/ceilometer-compute/Dockerfile.j2
@@ -0,0 +1,20 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ceilometer-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y openstack-ceilometer-compute \
+ python-ceilometerclient \
+ python-pecan \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-compute/config-external.sh b/docker/ceilometer/ceilometer-compute/config-external.sh
new file mode 100644
index 000000000..2835bd5aa
--- /dev/null
+++ b/docker/ceilometer/ceilometer-compute/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/ceilometer/ceilometer.conf"
+TARGET="/etc/ceilometer/ceilometer.conf"
+OWNER="ceilometer"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ceilometer/ceilometer-compute/start.sh b/docker/ceilometer/ceilometer-compute/start.sh
new file mode 100755
index 000000000..19d90be2f
--- /dev/null
+++ b/docker/ceilometer/ceilometer-compute/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/ceilometer-agent-compute"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/ceilometer/ceilometer-notification/Dockerfile.j2 b/docker/ceilometer/ceilometer-notification/Dockerfile.j2
new file mode 100644
index 000000000..67fcfb50e
--- /dev/null
+++ b/docker/ceilometer/ceilometer-notification/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ceilometer-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y openstack-ceilometer-notification \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ceilometer/ceilometer-notification/config-external.sh b/docker/ceilometer/ceilometer-notification/config-external.sh
new file mode 100644
index 000000000..2835bd5aa
--- /dev/null
+++ b/docker/ceilometer/ceilometer-notification/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/ceilometer/ceilometer.conf"
+TARGET="/etc/ceilometer/ceilometer.conf"
+OWNER="ceilometer"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ceilometer/ceilometer-notification/start.sh b/docker/ceilometer/ceilometer-notification/start.sh
new file mode 100755
index 000000000..8ce4b4488
--- /dev/null
+++ b/docker/ceilometer/ceilometer-notification/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/ceilometer-agent-notification"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/cinder/cinder-api/Dockerfile.j2 b/docker/cinder/cinder-api/Dockerfile.j2
new file mode 100644
index 000000000..196f93baf
--- /dev/null
+++ b/docker/cinder/cinder-api/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y python-keystone \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/cinder/cinder-api/config-external.sh b/docker/cinder/cinder-api/config-external.sh
new file mode 100644
index 000000000..08d8cde0a
--- /dev/null
+++ b/docker/cinder/cinder-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/cinder-api/cinder.conf"
+TARGET="/etc/cinder/cinder.conf"
+OWNER="cinder"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/cinder/cinder-api/start.sh b/docker/cinder/cinder-api/start.sh
new file mode 100755
index 000000000..6c61b3a4e
--- /dev/null
+++ b/docker/cinder/cinder-api/start.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/cinder-api"
+ARGS="--config-file /etc/cinder/cinder.conf"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "cinder-manage db sync" cinder
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/cinder/cinder-backup/Dockerfile.j2 b/docker/cinder/cinder-backup/Dockerfile.j2
new file mode 100644
index 000000000..fa331b195
--- /dev/null
+++ b/docker/cinder/cinder-backup/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/cinder/cinder-backup/config-external.sh b/docker/cinder/cinder-backup/config-external.sh
new file mode 100644
index 000000000..ff4752492
--- /dev/null
+++ b/docker/cinder/cinder-backup/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/cinder-backup/cinder.conf"
+TARGET="/etc/cinder/cinder.conf"
+OWNER="cinder"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/cinder/cinder-backup/start.sh b/docker/cinder/cinder-backup/start.sh
new file mode 100755
index 000000000..7d9403f07
--- /dev/null
+++ b/docker/cinder/cinder-backup/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/cinder-backup"
+ARGS="--config-file /etc/cinder/cinder.conf"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/cinder/cinder-base/Dockerfile.j2 b/docker/cinder/cinder-base/Dockerfile.j2
new file mode 100644
index 000000000..1cce34a9e
--- /dev/null
+++ b/docker/cinder/cinder-base/Dockerfile.j2
@@ -0,0 +1,49 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-cinder \
+ python-automaton \
+ lvm2 \
+ && yum clean all \
+ && sed -i "s|udev_rules = 1|udev_rules = 0|g" /etc/lvm/lvm.conf \
+ && sed -i "s|udev_sync = 1|udev_sync = 0|g" /etc/lvm/lvm.conf
+
+# NOTE(sdake): The sed operations make LVM tools work inside a container - see
+# https://groups.google.com/forum/#!topic/docker-user/n4Xtvsb4RAw
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install lvm2 \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends lvm2 \
+ && apt-get clean
+
+ {% endif %}
+
+ADD cinder.tar /
+RUN ln -s /cinder-* cinder \
+ && useradd --user-group cinder \
+ && pip --no-cache-dir install /cinder \
+ && mkdir -p /etc/cinder /var/log/cinder /home/cinder \
+ && cp -r /cinder/etc/cinder/* /etc/cinder/ \
+ && chown -R cinder: /etc/cinder /var/log/cinder /home/cinder \
+ && sed -i "s|udev_rules = 1|udev_rules = 0|g" /etc/lvm/lvm.conf \
+ && sed -i "s|udev_sync = 1|udev_sync = 0|g" /etc/lvm/lvm.conf
+
+# NOTE(sdake): The sed operations make LVM tools work inside a container - see
+# https://groups.google.com/forum/#!topic/docker-user/n4Xtvsb4RAw
+
+{% endif %}
diff --git a/docker/cinder/cinder-scheduler/Dockerfile.j2 b/docker/cinder/cinder-scheduler/Dockerfile.j2
new file mode 100644
index 000000000..fa331b195
--- /dev/null
+++ b/docker/cinder/cinder-scheduler/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/cinder/cinder-scheduler/config-external.sh b/docker/cinder/cinder-scheduler/config-external.sh
new file mode 100644
index 000000000..3c8ca26be
--- /dev/null
+++ b/docker/cinder/cinder-scheduler/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/cinder-scheduler/cinder.conf"
+TARGET="/etc/cinder/cinder.conf"
+OWNER="cinder"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/cinder/cinder-scheduler/start.sh b/docker/cinder/cinder-scheduler/start.sh
new file mode 100755
index 000000000..759175e3f
--- /dev/null
+++ b/docker/cinder/cinder-scheduler/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/cinder-scheduler"
+ARGS="--config-file /etc/cinder/cinder.conf"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/cinder/cinder-volume/Dockerfile.j2 b/docker/cinder/cinder-volume/Dockerfile.j2
new file mode 100644
index 000000000..6393798bd
--- /dev/null
+++ b/docker/cinder/cinder-volume/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-cinder-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y lvm2 \
+ scsi-target-utils \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/cinder/cinder-volume/config-external.sh b/docker/cinder/cinder-volume/config-external.sh
new file mode 100755
index 000000000..2f6b99fc9
--- /dev/null
+++ b/docker/cinder/cinder-volume/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/cinder-volume/cinder.conf"
+TARGET="/etc/cinder/cinder.conf"
+OWNER="cinder"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/cinder/cinder-volume/start.sh b/docker/cinder/cinder-volume/start.sh
new file mode 100755
index 000000000..a6874ce47
--- /dev/null
+++ b/docker/cinder/cinder-volume/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/cinder-volume"
+ARGS="--config-file /etc/cinder/cinder.conf"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/data/Dockerfile.j2 b/docker/data/Dockerfile.j2
new file mode 100644
index 000000000..7fecdb068
--- /dev/null
+++ b/docker/data/Dockerfile.j2
@@ -0,0 +1,6 @@
+FROM {{ base_distro }}:{{ base_distro_tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+CMD /bin/sleep infinity
+
+{{ include_footer }}
diff --git a/docker/designate/designate-api/Dockerfile.j2 b/docker/designate/designate-api/Dockerfile.j2
new file mode 100644
index 000000000..75f4b06ee
--- /dev/null
+++ b/docker/designate/designate-api/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-designate-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum install -y \
+ openstack-designate-api \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /start.sh
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/designate/designate-api/config-external.sh b/docker/designate/designate-api/config-external.sh
new file mode 100644
index 000000000..ce302ea0c
--- /dev/null
+++ b/docker/designate/designate-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/designate/designate.conf"
+TARGET="/etc/designate/designate.conf"
+OWNER="designate"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/designate/designate-api/start.sh b/docker/designate/designate-api/start.sh
new file mode 100755
index 000000000..fe556225b
--- /dev/null
+++ b/docker/designate/designate-api/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -o errexit
+CMD="/usr/bin/designate-api"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "designate-manage db_sync" designate
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/designate/designate-backend-bind9/Dockerfile.j2 b/docker/designate/designate-backend-bind9/Dockerfile.j2
new file mode 100644
index 000000000..06f86c043
--- /dev/null
+++ b/docker/designate/designate-backend-bind9/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-designate-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum install -y bind \
+ && yum clean all \
+ && cp -pr /var/named /opt/kolla/var-named
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /start.sh
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/designate/designate-backend-bind9/config-external.sh b/docker/designate/designate-backend-bind9/config-external.sh
new file mode 100644
index 000000000..ce302ea0c
--- /dev/null
+++ b/docker/designate/designate-backend-bind9/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/designate/designate.conf"
+TARGET="/etc/designate/designate.conf"
+OWNER="designate"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/designate/designate-backend-bind9/start.sh b/docker/designate/designate-backend-bind9/start.sh
new file mode 100755
index 000000000..11922974a
--- /dev/null
+++ b/docker/designate/designate-backend-bind9/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -o errexit
+CMD="/usr/sbin/named"
+ARGS="-u named -g"
+
+# Execute config strategy
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/designate/designate-base/Dockerfile.j2 b/docker/designate/designate-base/Dockerfile.j2
new file mode 100644
index 000000000..3fec3a6f7
--- /dev/null
+++ b/docker/designate/designate-base/Dockerfile.j2
@@ -0,0 +1,37 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+# Install designate-api because of /etc/designate/policy.json, which
+# is needed in all services. This is probably a packaging bug. We do
+# need the complete policy file because of some of the containers'
+# requiring it. Remove the package when the file is moved though.
+RUN yum install -y \
+ MySQL-python \
+ openstack-designate-api \
+ openstack-designate-common \
+ python-tooz \
+ && yum clean all \
+ && cp /etc/designate/policy.json /tmp/ \
+ && rpm -e openstack-designate-api \
+ && mv /tmp/policy.json /etc/designate/
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type}} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+
+ADD designate.tar /
+RUN ln -s /designate-* designate \
+ && useradd --user-group designate \
+ && pip --no-cache-dir install /designate \
+ && mkdir -p /etc/designate /var/log/designate /home/designate \
+ && cp -r /designate/etc/designate/* /etc/designate/ \
+ && chown -R designate: /etc/designate /var/log/designate /home/designate
+
+{% endif %}
diff --git a/docker/designate/designate-central/Dockerfile.j2 b/docker/designate/designate-central/Dockerfile.j2
new file mode 100644
index 000000000..771ff3c68
--- /dev/null
+++ b/docker/designate/designate-central/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-designate-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum install -y \
+ openstack-designate-central \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /start.sh
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/designate/designate-central/config-external.sh b/docker/designate/designate-central/config-external.sh
new file mode 100644
index 000000000..ce302ea0c
--- /dev/null
+++ b/docker/designate/designate-central/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/designate/designate.conf"
+TARGET="/etc/designate/designate.conf"
+OWNER="designate"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/designate/designate-central/start.sh b/docker/designate/designate-central/start.sh
new file mode 100755
index 000000000..eac012d3d
--- /dev/null
+++ b/docker/designate/designate-central/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -o errexit
+CMD="/usr/bin/designate-central"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/designate/designate-mdns/Dockerfile.j2 b/docker/designate/designate-mdns/Dockerfile.j2
new file mode 100644
index 000000000..cc5f5fb89
--- /dev/null
+++ b/docker/designate/designate-mdns/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-designate-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum install -y openstack-designate-mdns \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /start.sh
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/designate/designate-mdns/config-external.sh b/docker/designate/designate-mdns/config-external.sh
new file mode 100644
index 000000000..ce302ea0c
--- /dev/null
+++ b/docker/designate/designate-mdns/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/designate/designate.conf"
+TARGET="/etc/designate/designate.conf"
+OWNER="designate"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/designate/designate-mdns/start.sh b/docker/designate/designate-mdns/start.sh
new file mode 100755
index 000000000..b4bcda20c
--- /dev/null
+++ b/docker/designate/designate-mdns/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -o errexit
+CMD="/usr/bin/designate-mdns"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/designate/designate-poolmanager/Dockerfile.j2 b/docker/designate/designate-poolmanager/Dockerfile.j2
new file mode 100644
index 000000000..0fc968b90
--- /dev/null
+++ b/docker/designate/designate-poolmanager/Dockerfile.j2
@@ -0,0 +1,21 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-designate-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+# The bind9 package here is only to provide the rndc binary.
+RUN yum install -y \
+ openstack-designate-pool-manager \
+ bind \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /start.sh
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/designate/designate-poolmanager/config-external.sh b/docker/designate/designate-poolmanager/config-external.sh
new file mode 100644
index 000000000..ce302ea0c
--- /dev/null
+++ b/docker/designate/designate-poolmanager/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/designate/designate.conf"
+TARGET="/etc/designate/designate.conf"
+OWNER="designate"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/designate/designate-poolmanager/start.sh b/docker/designate/designate-poolmanager/start.sh
new file mode 100755
index 000000000..0752b9847
--- /dev/null
+++ b/docker/designate/designate-poolmanager/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -o errexit
+CMD="/usr/bin/designate-pool-manager"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/designate/designate-sink/Dockerfile.j2 b/docker/designate/designate-sink/Dockerfile.j2
new file mode 100644
index 000000000..c0ea23b2d
--- /dev/null
+++ b/docker/designate/designate-sink/Dockerfile.j2
@@ -0,0 +1,20 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-designate-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum install -y \
+ openstack-designate-sink \
+ python-designateclient \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /start.sh
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/designate/designate-sink/config-external.sh b/docker/designate/designate-sink/config-external.sh
new file mode 100644
index 000000000..ce302ea0c
--- /dev/null
+++ b/docker/designate/designate-sink/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/designate/designate.conf"
+TARGET="/etc/designate/designate.conf"
+OWNER="designate"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/designate/designate-sink/start.sh b/docker/designate/designate-sink/start.sh
new file mode 100755
index 000000000..d2f93e26f
--- /dev/null
+++ b/docker/designate/designate-sink/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -o errexit
+CMD="/usr/bin/designate-sink"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/galera/Dockerfile.j2 b/docker/galera/Dockerfile.j2
new file mode 100644
index 000000000..38e66ee14
--- /dev/null
+++ b/docker/galera/Dockerfile.j2
@@ -0,0 +1,42 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y \
+ MariaDB-Galera-server \
+ MariaDB-client \
+ rsync \
+ galera \
+ socat \
+ hostname \
+ percona-xtrabackup \
+ pv \
+ tar \
+ expect \
+ && rm -rf /var/lib/mysql/*
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+# At the end of this run statement we symlink two folders to match the folder
+# structure of the RPM family for mysql configs. This allows us to not change
+# the config-external.sh code
+# TODO(SamYaple): Remove that symlink once config-external is updated
+RUN apt-get install -y --no-install-recommends \
+ mariadb-galera-server \
+ percona-xtrabackup \
+ socat \
+ expect \
+ && apt-get clean \
+ && rm -rf /var/lib/mysql/* \
+ && ln -s /etc/mysql/conf.d/ /etc/my.cnf.d
+
+{% endif %}
+
+COPY config-galera.sh /opt/kolla/config/
+COPY config-external.sh /opt/kolla/
+COPY start.sh /
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/galera/config-external.sh b/docker/galera/config-external.sh
new file mode 100644
index 000000000..43447a51c
--- /dev/null
+++ b/docker/galera/config-external.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+SOURCE="/opt/kolla/mariadb/galera.cnf"
+TARGET="/etc/my.cnf.d/galera.cnf"
+OWNER="mysql"
+
+# Cluster configuration
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0600 $TARGET
+fi
diff --git a/docker/galera/config-galera.sh b/docker/galera/config-galera.sh
new file mode 100755
index 000000000..e66084001
--- /dev/null
+++ b/docker/galera/config-galera.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+function bootstrap_db {
+ mysqld_safe --wsrep-new-cluster &
+
+ # Waiting for deamon
+ sleep 10
+ expect -c '
+ set timeout 10
+ spawn mysql_secure_installation
+ expect "Enter current password for root (enter for none):"
+ send "\r"
+ expect "Set root password?"
+ send "y\r"
+ expect "New password:"
+ send "'"${DB_ROOT_PASSWORD}"'\r"
+ expect "Re-enter new password:"
+ send "'"${DB_ROOT_PASSWORD}"'\r"
+ expect "Remove anonymous users?"
+ send "y\r"
+ expect "Disallow root login remotely?"
+ send "n\r"
+ expect "Remove test database and access to it?"
+ send "y\r"
+ expect "Reload privilege tables now?"
+ send "y\r"
+ expect eof'
+
+ mysql -u root --password="${DB_ROOT_PASSWORD}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASSWORD}' WITH GRANT OPTION;"
+ mysql -u root --password="${DB_ROOT_PASSWORD}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '${DB_ROOT_PASSWORD}' WITH GRANT OPTION;"
+ mysqladmin -p"${DB_ROOT_PASSWORD}" shutdown
+}
+
+function populate_db {
+ mysql_install_db
+ chown -R mysql: /var/lib/mysql
+}
diff --git a/docker/galera/start.sh b/docker/galera/start.sh
new file mode 100755
index 000000000..f8f8d7f77
--- /dev/null
+++ b/docker/galera/start.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/mysqld_safe"
+ARGS=""
+
+# loading common functions
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# loading functions
+source /opt/kolla/config/config-galera.sh
+
+# This catches all cases of the BOOTSTRAP variable being set, including empty
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
+ ARGS="--wsrep-new-cluster"
+ touch /var/lib/mysql/cluster.exists
+ populate_db
+ bootstrap_db
+fi
+
+exec $CMD $ARGS
diff --git a/docker/glance/glance-api/Dockerfile.j2 b/docker/glance/glance-api/Dockerfile.j2
new file mode 100644
index 000000000..e603a6c36
--- /dev/null
+++ b/docker/glance/glance-api/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-glance-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/glance/glance-api/config-external.sh b/docker/glance/glance-api/config-external.sh
new file mode 100755
index 000000000..ce5411738
--- /dev/null
+++ b/docker/glance/glance-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/glance-api/glance-api.conf"
+TARGET="/etc/glance/glance-api.conf"
+OWNER="glance"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/glance/glance-api/start.sh b/docker/glance/glance-api/start.sh
new file mode 100755
index 000000000..ce3cb6d8b
--- /dev/null
+++ b/docker/glance/glance-api/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/glance-api"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "glance-manage db_sync" glance
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/glance/glance-base/Dockerfile.j2 b/docker/glance/glance-base/Dockerfile.j2
new file mode 100644
index 000000000..8fad82106
--- /dev/null
+++ b/docker/glance/glance-base/Dockerfile.j2
@@ -0,0 +1,28 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-glance \
+ python-oslo-i18n \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+
+ADD glance.tar /
+RUN ln -s /glance-* glance \
+ && useradd --user-group glance \
+ && pip --no-cache-dir install /glance \
+ && mkdir -p /etc/glance /var/log/glance /home/glance \
+ && cp -r /glance/etc/* /etc/glance/ \
+ && chown -R glance: /etc/glance /var/log/glance /home/glance
+
+{% endif %}
diff --git a/docker/glance/glance-registry/Dockerfile.j2 b/docker/glance/glance-registry/Dockerfile.j2
new file mode 100644
index 000000000..e603a6c36
--- /dev/null
+++ b/docker/glance/glance-registry/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-glance-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/glance/glance-registry/config-external.sh b/docker/glance/glance-registry/config-external.sh
new file mode 100755
index 000000000..37abd136d
--- /dev/null
+++ b/docker/glance/glance-registry/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/glance-registry/glance-registry.conf"
+TARGET="/etc/glance/glance-registry.conf"
+OWNER="glance"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/glance/glance-registry/start.sh b/docker/glance/glance-registry/start.sh
new file mode 100755
index 000000000..1d8265f80
--- /dev/null
+++ b/docker/glance/glance-registry/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/glance-registry"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/gnocchi/gnocchi-api/Dockerfile.j2 b/docker/gnocchi/gnocchi-api/Dockerfile.j2
new file mode 100644
index 000000000..9ca70113c
--- /dev/null
+++ b/docker/gnocchi/gnocchi-api/Dockerfile.j2
@@ -0,0 +1,21 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-gnocchi-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y \
+ openstack-gnocchi-api \
+ openstack-gnocchi-carbonara \
+ openstack-gnocchi-indexer-sqlalchemy \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/gnocchi/gnocchi-api/config-external.sh b/docker/gnocchi/gnocchi-api/config-external.sh
new file mode 100644
index 000000000..59639ba63
--- /dev/null
+++ b/docker/gnocchi/gnocchi-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/gnocchi-api/gnocchi-api.conf"
+TARGET="/etc/gnocchi/gnocchi-api.conf"
+OWNER="gnocchi"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/gnocchi/gnocchi-api/start.sh b/docker/gnocchi/gnocchi-api/start.sh
new file mode 100755
index 000000000..657368a27
--- /dev/null
+++ b/docker/gnocchi/gnocchi-api/start.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/gnocchi-api"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "gnocchi-manage db_sync" gnocchi
+ exit 0
+fi
+
+exec $CMD $ARGS
+
diff --git a/docker/gnocchi/gnocchi-base/Dockerfile.j2 b/docker/gnocchi/gnocchi-base/Dockerfile.j2
new file mode 100644
index 000000000..be8840073
--- /dev/null
+++ b/docker/gnocchi/gnocchi-base/Dockerfile.j2
@@ -0,0 +1,25 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+{% elif install_type == 'source' %}
+ {% if base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends libpq-dev \
+ && apt-get clean
+
+ {% endif %}
+
+ADD gnocchi.tar /
+RUN ln -s /gnocchi-* gnocchi \
+ && useradd --user-group gnocchi \
+ && pip --no-cache-dir install /gnocchi \
+ && mkdir -p /etc/gnocchi /var/log/gnocchi /home/gnocchi \
+ && cp -r /gnocchi/etc/* /etc/gnocchi/ \
+ && chown -R gnocchi: /etc/gnocchi /var/log/gnocchi /home/gnocchi
+
+{% endif %}
diff --git a/docker/gnocchi/gnocchi-statsd/Dockerfile.j2 b/docker/gnocchi/gnocchi-statsd/Dockerfile.j2
new file mode 100644
index 000000000..99f1374a2
--- /dev/null
+++ b/docker/gnocchi/gnocchi-statsd/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-gnocchi-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum install -y openstack-gnocchi-statsd \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/gnocchi/gnocchi-statsd/config-external.sh b/docker/gnocchi/gnocchi-statsd/config-external.sh
new file mode 100644
index 000000000..59639ba63
--- /dev/null
+++ b/docker/gnocchi/gnocchi-statsd/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/gnocchi-api/gnocchi-api.conf"
+TARGET="/etc/gnocchi/gnocchi-api.conf"
+OWNER="gnocchi"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/gnocchi/gnocchi-statsd/start.sh b/docker/gnocchi/gnocchi-statsd/start.sh
new file mode 100755
index 000000000..636e71323
--- /dev/null
+++ b/docker/gnocchi/gnocchi-statsd/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/gnocchi-statsd"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
+
diff --git a/docker/haproxy/Dockerfile.j2 b/docker/haproxy/Dockerfile.j2
new file mode 100755
index 000000000..2858f436a
--- /dev/null
+++ b/docker/haproxy/Dockerfile.j2
@@ -0,0 +1,27 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ haproxy \
+ && yum clean all
+
+{% elif base_distro == 'ubuntu' %}
+
+RUN apt-get install -y --no-install-recommends -t trusty-backports haproxy \
+ && apt-get clean
+
+{% elif base_distro == 'debian' %}
+
+RUN apt-get install -y --no-install-recommends haproxy \
+ && apt-get clean
+
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh ensure_latest_config.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/haproxy/config-external.sh b/docker/haproxy/config-external.sh
new file mode 100644
index 000000000..0c41a5bdb
--- /dev/null
+++ b/docker/haproxy/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/haproxy/haproxy.cfg"
+TARGET="/etc/haproxy/haproxy.cfg"
+OWNER="root"
+
+if [[ -f "$SOURCE" ]]; then
+ cp -f $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/haproxy/ensure_latest_config.sh b/docker/haproxy/ensure_latest_config.sh
new file mode 100755
index 000000000..b91189ca5
--- /dev/null
+++ b/docker/haproxy/ensure_latest_config.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+CURRENT_CONFIG_HASH=$(sha1sum /etc/haproxy/haproxy.cfg | cut -f1 -d' ')
+NEW_CONFIG_HASH=$(sha1sum /opt/kolla/haproxy/haproxy.cfg | cut -f1 -d' ')
+
+if [[ $CURRENT_CONFIG_HASH != $NEW_CONFIG_HASH ]]; then
+ changed=changed
+ source /opt/kolla/config-external.sh
+ /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -sf $(cat /run/haproxy.pid)
+fi
+
+echo $changed
diff --git a/docker/haproxy/start.sh b/docker/haproxy/start.sh
new file mode 100755
index 000000000..d1da4a607
--- /dev/null
+++ b/docker/haproxy/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -o errexit
+
+CMD='/usr/sbin/haproxy'
+ARGS="-f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# We are intentionally not using exec so we can reload the haproxy config later
+$CMD $ARGS
+
+# TODO(SamYaple): This has the potential for a race condition triggered by a
+# config reload that could cause the container to exit
+while [[ -e "/proc/$(cat /run/haproxy.pid)" ]]; do
+ sleep 5
+done
diff --git a/docker/heat/heat-api-cfn/Dockerfile.j2 b/docker/heat/heat-api-cfn/Dockerfile.j2
new file mode 100644
index 000000000..f199c16cf
--- /dev/null
+++ b/docker/heat/heat-api-cfn/Dockerfile.j2
@@ -0,0 +1,25 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-heat-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-heat-api-cfn \
+ python-openstackclient \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/heat/heat-api-cfn/config-external.sh b/docker/heat/heat-api-cfn/config-external.sh
new file mode 100644
index 000000000..91d5742f1
--- /dev/null
+++ b/docker/heat/heat-api-cfn/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/heat-api-cfn/heat.conf"
+TARGET="/etc/heat/heat.conf"
+OWNER="heat"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/heat/heat-api-cfn/start.sh b/docker/heat/heat-api-cfn/start.sh
new file mode 100755
index 000000000..54b533185
--- /dev/null
+++ b/docker/heat/heat-api-cfn/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/heat-api-cfn"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/heat/heat-api/Dockerfile.j2 b/docker/heat/heat-api/Dockerfile.j2
new file mode 100644
index 000000000..8a782d8d3
--- /dev/null
+++ b/docker/heat/heat-api/Dockerfile.j2
@@ -0,0 +1,25 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-heat-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-heat-api \
+ python-openstackclient \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/heat/heat-api/config-external.sh b/docker/heat/heat-api/config-external.sh
new file mode 100644
index 000000000..ca5d73e90
--- /dev/null
+++ b/docker/heat/heat-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/heat-api/heat-api.conf"
+TARGET="/etc/heat/heat-api.conf"
+OWNER="heat"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/heat/heat-api/start.sh b/docker/heat/heat-api/start.sh
new file mode 100755
index 000000000..a7b14b1d9
--- /dev/null
+++ b/docker/heat/heat-api/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/heat-api"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/heat/heat-base/Dockerfile.j2 b/docker/heat/heat-base/Dockerfile.j2
new file mode 100644
index 000000000..408167e90
--- /dev/null
+++ b/docker/heat/heat-base/Dockerfile.j2
@@ -0,0 +1,27 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ python-oslo-reports \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+
+ADD heat.tar /
+RUN ln -s /heat-* heat \
+ && useradd --user-group heat \
+ && pip --no-cache-dir install /heat \
+ && mkdir -p /etc/heat /var/log/heat /home/heat \
+ && cp -r /heat/etc/heat/* /etc/heat/ \
+ && chown -R heat: /etc/heat /var/log/heat /home/heat
+
+{% endif %}
diff --git a/docker/heat/heat-engine/Dockerfile.j2 b/docker/heat/heat-engine/Dockerfile.j2
new file mode 100644
index 000000000..5002d519d
--- /dev/null
+++ b/docker/heat/heat-engine/Dockerfile.j2
@@ -0,0 +1,28 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-heat-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ # until http://pkgs.fedoraproject.org/cgit/openstack-heat.git/tree/openstack-heat.spec#n248 \
+ # is updated, the clients must remain here: \
+ python-barbicanclient \
+ python-zaqarclient \
+ openstack-heat-engine \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/heat/heat-engine/config-external.sh b/docker/heat/heat-engine/config-external.sh
new file mode 100644
index 000000000..bde0ffe0d
--- /dev/null
+++ b/docker/heat/heat-engine/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/heat-engine/heat.conf"
+TARGET="/etc/heat/heat.conf"
+OWNER="heat"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/heat/heat-engine/start.sh b/docker/heat/heat-engine/start.sh
new file mode 100755
index 000000000..8f9a6f1cb
--- /dev/null
+++ b/docker/heat/heat-engine/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/heat-engine"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/bash -c "/usr/bin/heat-manage db_sync" heat
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2
new file mode 100644
index 000000000..2fe69b3d2
--- /dev/null
+++ b/docker/horizon/Dockerfile.j2
@@ -0,0 +1,58 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-dashboard \
+ httpd \
+ mod_wsgi \
+ && yum clean all \
+ && chown -R apache: /usr/share/openstack-dashboard/static
+
+# The chown is required because of this packaging bug:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1219006
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum install -y \
+ httpd \
+ mod_wsgi \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ apache2 \
+ libapache2-mod-wsgi \
+ && echo > /etc/apache2/ports.conf \
+ && apt-get clean
+
+ {% endif %}
+
+ADD horizon.tar /
+RUN ln -s /horizon-* horizon \
+ && pip --no-cache-dir install /horizon \
+ && useradd --user-group horizon \
+ && mkdir -p /etc/openstack-dashboard /home/horizon \
+ && ln -s openstack_dashboard/static/ /usr/lib/python2.7/site-packages/static \
+ && ln -s /etc/openstack-dashboard/local_settings /usr/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py \
+ && cp -r /horizon/openstack_dashboard/conf/* /etc/openstack-dashboard/ \
+ && chown -R horizon: /etc/openstack-dashboard /home/horizon /usr/lib/python2.7/site-packages/openstack_dashboard/static
+
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/horizon/config-external.sh b/docker/horizon/config-external.sh
new file mode 100644
index 000000000..8e9fc47a0
--- /dev/null
+++ b/docker/horizon/config-external.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+SOURCE="/opt/kolla/horizon/local_settings"
+TARGET="/etc/openstack-dashboard/local_settings"
+OWNER="horizon"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
+
+if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
+ "${KOLLA_BASE_DISTRO}" == "debian" ]]; then
+ SOURCE="/opt/kolla/horizon/horizon.conf"
+ TARGET="/etc/apache2/sites-enabled/000-default.conf"
+else
+ SOURCE="/opt/kolla/horizon/horizon.conf"
+ TARGET="/etc/httpd/sites.d/horizon.conf"
+fi
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/horizon/start.sh b/docker/horizon/start.sh
new file mode 100755
index 000000000..096326a3a
--- /dev/null
+++ b/docker/horizon/start.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -o errexit
+
+# Loading common functions
+source /opt/kolla/kolla-common.sh
+
+if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
+ "${KOLLA_BASE_DISTRO}" == "debian" ]]; then
+ CMD="/usr/sbin/apache2"
+ ARGS="-DFOREGROUND"
+
+ # Loading Apache2 ENV variables
+ source /etc/apache2/envvars
+else
+ CMD="/usr/sbin/httpd"
+ ARGS="-DFOREGROUND"
+fi
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/ironic/ironic-api/Dockerfile.j2 b/docker/ironic/ironic-api/Dockerfile.j2
new file mode 100644
index 000000000..5bce3bdda
--- /dev/null
+++ b/docker/ironic/ironic-api/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ironic-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-ironic-api \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ironic/ironic-api/config-external.sh b/docker/ironic/ironic-api/config-external.sh
new file mode 100644
index 000000000..b838ee19d
--- /dev/null
+++ b/docker/ironic/ironic-api/config-external.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+SOURCE="/opt/kolla/ironic-api/ironic.conf"
+TARGET="/etc/ironic/ironic.conf"
+OWNER="ironic"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ironic/ironic-api/start.sh b/docker/ironic/ironic-api/start.sh
new file mode 100755
index 000000000..9d449defb
--- /dev/null
+++ b/docker/ironic/ironic-api/start.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/ironic-api"
+ARGS=""
+
+source /opt/kolla/kolla-common.sh
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/ironic/ironic-base/Dockerfile.j2 b/docker/ironic/ironic-base/Dockerfile.j2
new file mode 100644
index 000000000..0fc7e56c2
--- /dev/null
+++ b/docker/ironic/ironic-base/Dockerfile.j2
@@ -0,0 +1,33 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+# until packaging is fixed, all of this is required
+# api: policy
+# conductor:MySQL-python
+RUN yum -y install \
+ python-oslo-log \
+ python-oslo-concurrency \
+ python-oslo-policy \
+ MySQL-python \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+
+ADD ironic.tar /
+RUN ln -s /ironic-* ironic \
+ && useradd --user-group ironic \
+ && pip --no-cache-dir install /ironic \
+ && mkdir -p /etc/ironic /var/log/ironic /home/ironic \
+ && cp -r /ironic/etc/* /etc/ironic/ \
+ && chown -R ironic: /etc/ironic /var/log/ironic /home/ironic
+
+{% endif %}
diff --git a/docker/ironic/ironic-conductor/Dockerfile.j2 b/docker/ironic/ironic-conductor/Dockerfile.j2
new file mode 100644
index 000000000..d38033230
--- /dev/null
+++ b/docker/ironic/ironic-conductor/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ironic-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-ironic-conductor \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ironic/ironic-conductor/config-external.sh b/docker/ironic/ironic-conductor/config-external.sh
new file mode 100644
index 000000000..b838ee19d
--- /dev/null
+++ b/docker/ironic/ironic-conductor/config-external.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+SOURCE="/opt/kolla/ironic-api/ironic.conf"
+TARGET="/etc/ironic/ironic.conf"
+OWNER="ironic"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ironic/ironic-conductor/start.sh b/docker/ironic/ironic-conductor/start.sh
new file mode 100755
index 000000000..c766f04c5
--- /dev/null
+++ b/docker/ironic/ironic-conductor/start.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/ironic-conductor"
+ARGS=""
+
+source /opt/kolla/kolla-common.sh
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/ironic/ironic-discoverd/Dockerfile.j2 b/docker/ironic/ironic-discoverd/Dockerfile.j2
new file mode 100644
index 000000000..cb4e8b80f
--- /dev/null
+++ b/docker/ironic/ironic-discoverd/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ironic-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-ironic-discoverd \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/ironic/ironic-discoverd/config-external.sh b/docker/ironic/ironic-discoverd/config-external.sh
new file mode 100644
index 000000000..a3f82b8f3
--- /dev/null
+++ b/docker/ironic/ironic-discoverd/config-external.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+SOURCE="/opt/kolla/ironic-discoverd/discoverd.conf"
+TARGET="/etc/ironic-discoverd/discoverd.conf"
+OWNER="ironic"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/ironic/ironic-discoverd/start.sh b/docker/ironic/ironic-discoverd/start.sh
new file mode 100755
index 000000000..093dc517a
--- /dev/null
+++ b/docker/ironic/ironic-discoverd/start.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/ironic-discoverd"
+ARGS=""
+
+source /opt/kolla/kolla-common.sh
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/keepalived/Dockerfile.j2 b/docker/keepalived/Dockerfile.j2
new file mode 100644
index 000000000..325e4c2c5
--- /dev/null
+++ b/docker/keepalived/Dockerfile.j2
@@ -0,0 +1,26 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ hostname \
+ keepalived \
+ socat \
+ && yum clean all
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ keepalived \
+ socat \
+ && apt-get clean
+
+{% endif %}
+
+COPY start.sh check_alive.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/keepalived/check_alive.sh b/docker/keepalived/check_alive.sh
new file mode 100755
index 000000000..8c2684f10
--- /dev/null
+++ b/docker/keepalived/check_alive.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# This will return 0 when it successfully talks to the haproxy daemon via the socket
+# Failures return 1
+
+echo "show info" | socat unix-connect:/run/haproxy.sock stdio
diff --git a/docker/keepalived/config-external.sh b/docker/keepalived/config-external.sh
new file mode 100755
index 000000000..d7ff97826
--- /dev/null
+++ b/docker/keepalived/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/keepalived/keepalived.conf"
+TARGET="/etc/keepalived/keepalived.conf"
+OWNER="root"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/keepalived/start.sh b/docker/keepalived/start.sh
new file mode 100755
index 000000000..a122526e4
--- /dev/null
+++ b/docker/keepalived/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/sbin/keepalived"
+ARGS="-nld -p /run/keepalived.pid"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+modprobe ip_vs
+
+# Workaround for bug #1485079
+if [ -f /run/keepalived.pid ]; then
+ rm /run/keepalived.pid
+fi
+
+exec $CMD $ARGS
diff --git a/docker/keystone/Dockerfile.j2 b/docker/keystone/Dockerfile.j2
new file mode 100644
index 000000000..a3b686165
--- /dev/null
+++ b/docker/keystone/Dockerfile.j2
@@ -0,0 +1,71 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-keystone \
+ python-keystoneclient \
+ python-openstackclient \
+ httpd \
+ mod_wsgi \
+ && yum clean all
+
+RUN mkdir -p /var/www/cgi-bin/keystone \
+ && cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/main \
+ && cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/admin
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ apache2 \
+ keystone \
+ libapache2-mod-wsgi \
+ python-keystoneclient \
+ && apt-get clean
+
+RUN ln -s /etc/apache2/sites-available/wsgi-keystone.conf /etc/apache2/sites-enabled \
+ && mkdir -p /var/www/cgi-bin/keystone \
+ && cp -a /usr/share/keystone/wsgi.py /var/www/cgi-bin/keystone/main \
+ && cp -a /usr/share/keystone/wsgi.py /var/www/cgi-bin/keystone/admin
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ httpd \
+ mod_wsgi \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ apache2 \
+ libapache2-mod-wsgi \
+ && echo > /etc/apache2/ports.conf \
+ && apt-get clean
+
+ {% endif %}
+
+ADD keystone.tar /
+RUN ln -s /keystone-* keystone \
+ && useradd --user-group keystone \
+ && pip --no-cache-dir install /keystone \
+ && mkdir -p /etc/keystone /var/www/cgi-bin/keystone /var/log/apache2 /home/keystone \
+ && cp -r /keystone/etc/* /etc/keystone/ \
+ && cp /keystone/httpd/keystone.py /var/www/cgi-bin/keystone/admin \
+ && cp /keystone/httpd/keystone.py /var/www/cgi-bin/keystone/main \
+ && chown -R keystone: /etc/keystone /var/www/cgi-bin/keystone /var/log/apache2 /home/keystone
+
+{% endif %}
+
+RUN chown -R keystone: /var/www/cgi-bin/keystone \
+ && chmod 755 /var/www/cgi-bin/keystone/*
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/keystone/config-external.sh b/docker/keystone/config-external.sh
new file mode 100644
index 000000000..1bd4e3bb4
--- /dev/null
+++ b/docker/keystone/config-external.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+SOURCE="/opt/kolla/keystone/keystone.conf"
+TARGET="/etc/keystone/keystone.conf"
+OWNER="keystone"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
+
+if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
+ "${KOLLA_BASE_DISTRO}" == "debian" ]]; then
+ SOURCE_WSGI="/opt/kolla/keystone/wsgi-keystone.conf"
+ TARGET_WSGI="/etc/apache2/conf-enabled/wsgi-keystone.conf"
+else
+ SOURCE_WSGI="/opt/kolla/keystone/wsgi-keystone.conf"
+ TARGET_WSGI="/etc/httpd/conf.d/wsgi-keystone.conf"
+fi
+
+if [[ -f "$SOURCE_WSGI" ]]; then
+ cp $SOURCE_WSGI $TARGET_WSGI
+ chown ${OWNER}: $TARGET_WSGI
+ chmod 0644 $TARGET_WSGI
+fi
diff --git a/docker/keystone/start.sh b/docker/keystone/start.sh
new file mode 100755
index 000000000..d964b0303
--- /dev/null
+++ b/docker/keystone/start.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+set -o errexit
+
+# Loading common functions
+source /opt/kolla/kolla-common.sh
+
+if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
+ "${KOLLA_BASE_DISTRO}" == "debian" ]]; then
+ CMD="/usr/sbin/apache2"
+ ARGS="-DFOREGROUND"
+
+ # Loading Apache2 ENV variables
+ source /etc/apache2/envvars
+else
+ CMD="/usr/sbin/httpd"
+ ARGS="-DFOREGROUND"
+fi
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "keystone-manage db_sync" keystone
+
+ # Start the api to set initial endpoint and users with the admin_token
+ $CMD
+ sleep 5
+
+ keystone service-create --name keystone --type identity \
+ --description "OpenStack Identity"
+ keystone endpoint-create --region "${REGION_NAME}" \
+ --publicurl "${PUBLIC_URL}" \
+ --internalurl "${INTERNAL_URL}" \
+ --adminurl "${ADMIN_URL}" \
+ --service-id $(keystone service-list | awk '/ identity / {print $2}')
+
+ keystone tenant-create --description "Admin Project" --name admin
+ keystone user-create --pass "${KEYSTONE_ADMIN_PASSWORD}" --name admin
+ keystone role-create --name admin
+ keystone user-role-add --user admin --tenant admin --role admin
+
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/kolla-ansible/Dockerfile.j2 b/docker/kolla-ansible/Dockerfile.j2
new file mode 100644
index 000000000..9975f5873
--- /dev/null
+++ b/docker/kolla-ansible/Dockerfile.j2
@@ -0,0 +1,38 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ git \
+ gcc \
+ libffi-devel \
+ libxml2-devel \
+ libxslt-devel \
+ MySQL-python \
+ openssl-devel \
+ python-devel \
+ openssh-clients \
+ && yum clean all
+
+RUN pip install -U pip wheel
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends git
+
+{% endif %}
+
+RUN pip install shade
+
+RUN git clone --depth 1 https://github.com/ansible/ansible.git \
+ && cd ansible \
+ && git submodule update --init --recursive \
+ && pip install --install-option="--install-scripts=/usr/bin" .
+
+RUN mkdir -p /etc/ansible /usr/share/ansible \
+ && echo 'localhost ansible_connection=local' > /etc/ansible/hosts
+
+COPY kolla_keystone_service.py kolla_keystone_user.py /usr/share/ansible/
+
+{{ include_footer }}
diff --git a/docker/kolla-ansible/kolla_keystone_service.py b/docker/kolla-ansible/kolla_keystone_service.py
new file mode 100644
index 000000000..455aaf578
--- /dev/null
+++ b/docker/kolla-ansible/kolla_keystone_service.py
@@ -0,0 +1,84 @@
+#!/usr/bin/python
+
+# Copyright 2015 Sam Yaple
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is a barebones file needed to file a gap until Ansible 2.0. No error
+# checking, no deletions, no updates. Idempotent creation only.
+
+# If you look closely, you will see we arent _really_ using the shade module
+# we just use it to slightly abstract the authentication model. As patches land
+# in upstream shade we will be able to use more of the shade module. Until then
+# if we want to be 'stable' we really need to be using it as a passthrough
+
+import shade
+
+def main():
+ module = AnsibleModule(
+ argument_spec = openstack_full_argument_spec(
+ description = dict(required=True, type='str'),
+ service_name = dict(required=True, type='str'),
+ service_type = dict(required=True, type='str'),
+ admin_url = dict(required=True, type='str'),
+ internal_url = dict(required=True, type='str'),
+ public_url = dict(required=True, type='str'),
+ endpoint_region = dict(required=True, type='str')
+ )
+ )
+
+ try:
+ description = module.params.pop('description')
+ service_name = module.params.pop('service_name')
+ service_type = module.params.pop('service_type')
+ admin_url = module.params.pop('admin_url')
+ internal_url = module.params.pop('internal_url')
+ public_url = module.params.pop('public_url')
+ endpoint_region = module.params.pop('endpoint_region')
+
+ changed = False
+ service = None
+ endpoint = None
+
+ cloud = shade.operator_cloud(**module.params)
+
+ for _service in cloud.keystone_client.services.list():
+ if _service.type == service_type:
+ service = _service
+
+ if service is not None:
+ for _endpoint in cloud.keystone_client.endpoints.list():
+ if _endpoint.service_id == service.id:
+ endpoint = _endpoint
+ else:
+ service = cloud.keystone_client.services.create(name=service_name,
+ service_type=service_type,
+ description=description)
+
+ if endpoint is None:
+ changed = True
+ cloud.keystone_client.endpoints.create(service_id=service.id,
+ adminurl=admin_url,
+ internalurl=public_url,
+ publicurl=public_url,
+ region=endpoint_region)
+
+ module.exit_json(changed=changed)
+ except Exception as e:
+ module.exit_json(failed=True, changed=True, msg=e)
+
+# import module snippets
+from ansible.module_utils.basic import *
+from ansible.module_utils.openstack import *
+if __name__ == '__main__':
+ main()
diff --git a/docker/kolla-ansible/kolla_keystone_user.py b/docker/kolla-ansible/kolla_keystone_user.py
new file mode 100644
index 000000000..5d295c1e2
--- /dev/null
+++ b/docker/kolla-ansible/kolla_keystone_user.py
@@ -0,0 +1,83 @@
+#!/usr/bin/python
+
+# Copyright 2015 Sam Yaple
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is a barebones file needed to file a gap until Ansible 2.0. No error
+# checking, no deletions, no updates. Idempotent creation only.
+
+# If you look closely, you will see we arent _really_ using the shade module
+# we just use it to slightly abstract the authentication model. As patches land
+# in upstream shade we will be able to use more of the shade module. Until then
+# if we want to be 'stable' we really need to be using it as a passthrough
+
+import shade
+
+def main():
+ module = AnsibleModule(
+ argument_spec = openstack_full_argument_spec(
+ password = dict(required=True, type='str'),
+ project = dict(required=True, type='str'),
+ role = dict(required=True, type='str'),
+ user = dict(required=True, type='str')
+ )
+ )
+
+ try:
+ password = module.params.pop('password')
+ project_name = module.params.pop('project')
+ role_name = module.params.pop('role')
+ user_name = module.params.pop('user')
+
+ changed = False
+ project = None
+ role = None
+ user = None
+
+ cloud = shade.operator_cloud(**module.params)
+
+ for _project in cloud.keystone_client.tenants.list():
+ if _project.name == project_name:
+ project = _project
+
+ for _role in cloud.keystone_client.roles.list():
+ if _role.name == role_name:
+ role = _role
+
+ for _user in cloud.keystone_client.users.list():
+ if _user.name == user_name:
+ user = _user
+
+ if not project:
+ changed = True
+ project = cloud.keystone_client.tenants.create(tenant_name=project_name)
+
+ if not role:
+ changed = True
+ role = cloud.keystone_client.roles.create(name=role_name)
+
+ if not user:
+ changed = True
+ user = cloud.keystone_client.users.create(name=user_name, password=password, tenant_id=project.id)
+ cloud.keystone_client.roles.add_user_role(role=role.id, user=user.id, tenant=project.id)
+
+ module.exit_json(changed=changed)
+ except Exception as e:
+ module.exit_json(failed=True, changed=True, msg=e)
+
+# import module snippets
+from ansible.module_utils.basic import *
+from ansible.module_utils.openstack import *
+if __name__ == '__main__':
+ main()
diff --git a/docker/magnum/magnum-api/Dockerfile.j2 b/docker/magnum/magnum-api/Dockerfile.j2
new file mode 100644
index 000000000..e208a115e
--- /dev/null
+++ b/docker/magnum/magnum-api/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-magnum-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-magnum-api \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+
+{{ include_footer }}
diff --git a/docker/magnum/magnum-api/config-external.sh b/docker/magnum/magnum-api/config-external.sh
new file mode 100644
index 000000000..573043f7d
--- /dev/null
+++ b/docker/magnum/magnum-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/magnum/magnum-api/magnum.conf"
+TARGET="/etc/magnum/magnum.conf"
+OWNER="magnum"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/magnum/magnum-api/start.sh b/docker/magnum/magnum-api/start.sh
new file mode 100755
index 000000000..ed154e29a
--- /dev/null
+++ b/docker/magnum/magnum-api/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -o errexit
+CMD="/usr/bin/magnum-api"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "magnum-manage db_sync" magnum
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/magnum/magnum-base/Dockerfile.j2 b/docker/magnum/magnum-base/Dockerfile.j2
new file mode 100644
index 000000000..59c22f57e
--- /dev/null
+++ b/docker/magnum/magnum-base/Dockerfile.j2
@@ -0,0 +1,29 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos'] %}
+
+RUN curl https://copr.fedoraproject.org/coprs/sdake/openstack-magnum/repo/epel-7/sdake-openstack-magnum-epel-7.repo -o /etc/yum.repos.d/sdake-openstack-magnum-epel-7.repo
+
+ {% elif base_distro in ['fedora'] %}
+
+RUN curl https://copr.fedoraproject.org/coprs/sdake/openstack-magnum/repo/fedora-22/sdake-openstack-magnum-fedora-22.repo -o /etc/yum.repos.d/sdake-openstack-magnum-f22.repo
+
+ {% elif base_distro in ['ubuntu', 'debian', 'oraclelinux'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+
+ADD magnum.tar /
+RUN ln -s /magnum-* magnum \
+ && useradd --user-group magnum \
+ && pip --no-cache-dir install /magnum \
+ && mkdir -p /etc/magnum /var/log/magnum /home/magnum \
+ && cp -r /magnum/etc/* /etc/magnum/ \
+ && chown -R magnum: /etc/magnum /var/log/magnum /home/magnum
+
+{% endif %}
diff --git a/docker/magnum/magnum-conductor/Dockerfile.j2 b/docker/magnum/magnum-conductor/Dockerfile.j2
new file mode 100644
index 000000000..c14370085
--- /dev/null
+++ b/docker/magnum/magnum-conductor/Dockerfile.j2
@@ -0,0 +1,23 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-magnum-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-magnum-conductor \
+ tar \
+ && yum clean all
+
+# Install kubectl binary (ugh)
+RUN cd /tmp && curl -L https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v0.15.0/kubernetes.tar.gz -o /tmp/kubernetes.tar.gz && /usr/bin/tar -xzvf /tmp/kubernetes.tar.gz && cp -a /tmp/kubernetes/platforms/linux/amd64/kubectl /usr/bin/kubectl && rm -rf /tmp/kubernetes
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+
+{{ include_footer }}
diff --git a/docker/magnum/magnum-conductor/config-external.sh b/docker/magnum/magnum-conductor/config-external.sh
new file mode 100644
index 000000000..b96e3179e
--- /dev/null
+++ b/docker/magnum/magnum-conductor/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/magnum/magnum-conductor/magnum.conf"
+TARGET="/etc/magnum/magnum.conf"
+OWNER="magnum"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/magnum/magnum-conductor/start.sh b/docker/magnum/magnum-conductor/start.sh
new file mode 100755
index 000000000..a5c76ee85
--- /dev/null
+++ b/docker/magnum/magnum-conductor/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/magnum-conductor"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/memcached/Dockerfile.j2 b/docker/memcached/Dockerfile.j2
new file mode 100644
index 000000000..0c0111f7e
--- /dev/null
+++ b/docker/memcached/Dockerfile.j2
@@ -0,0 +1,21 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install memcached \
+ && yum clean all
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends memcached \
+ && apt-get clean
+
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/memcached/config-external.sh b/docker/memcached/config-external.sh
new file mode 100644
index 000000000..0f3fa8336
--- /dev/null
+++ b/docker/memcached/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/memcached/memcached.conf"
+TARGET="/etc/memcached.conf"
+OWNER="memcached"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/memcached/start.sh b/docker/memcached/start.sh
new file mode 100755
index 000000000..531dd3872
--- /dev/null
+++ b/docker/memcached/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/memcached"
+ARGS="-u memcached -vv"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+source /etc/memcached.conf
+
+exec $CMD $ARGS $OPTIONS
diff --git a/docker/mongodb/Dockerfile.j2 b/docker/mongodb/Dockerfile.j2
new file mode 100644
index 000000000..ee82f0b7a
--- /dev/null
+++ b/docker/mongodb/Dockerfile.j2
@@ -0,0 +1,25 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ mongodb \
+ mongodb-server \
+ && yum clean all
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends mongodb-server \
+ && apt-get clean
+
+{% endif %}
+
+RUN mkdir -p /data/db
+
+VOLUME /data/db
+VOLUME /var/log/mongodb
+
+ENTRYPOINT exec /bin/mongod --dbpath /data/db --logpath /var/log/mongodb/mongo.log --noprealloc --smallfiles
+
+{{ include_footer }}
diff --git a/docker/murano/murano-api/Dockerfile.j2 b/docker/murano/murano-api/Dockerfile.j2
new file mode 100644
index 000000000..f1d7e1f42
--- /dev/null
+++ b/docker/murano/murano-api/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-murano-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY config-external.sh /opt/kolla/
+COPY start.sh /
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/murano/murano-api/config-external.sh b/docker/murano/murano-api/config-external.sh
new file mode 100644
index 000000000..5d9a2da49
--- /dev/null
+++ b/docker/murano/murano-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/murano/murano.conf"
+TARGET="/etc/murano/murano.conf"
+OWNER="murano"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/murano/murano-api/start.sh b/docker/murano/murano-api/start.sh
new file mode 100755
index 000000000..7d712177d
--- /dev/null
+++ b/docker/murano/murano-api/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/murano-api"
+ARGS="--config-file /etc/murano/murano.conf"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "murano-db-manage --config-file /etc/murano/murano.conf upgrade" murano
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/murano/murano-base/Dockerfile.j2 b/docker/murano/murano-base/Dockerfile.j2
new file mode 100644
index 000000000..cb700e5e0
--- /dev/null
+++ b/docker/murano/murano-base/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+{% elif install_type == 'source' %}
+
+ADD murano.tar /
+RUN ln -s /murano-* murano \
+ && useradd --user-group murano \
+ && pip --no-cache-dir install /murano \
+ && mkdir -p /etc/murano /var/log/murano /home/murano \
+ && cp -r /murano/etc/murano/* /etc/murano/ \
+ && chown -R murano: /etc/murano /var/log/murano /home/murano
+
+{% endif %}
diff --git a/docker/murano/murano-engine/Dockerfile.j2 b/docker/murano/murano-engine/Dockerfile.j2
new file mode 100644
index 000000000..f1d7e1f42
--- /dev/null
+++ b/docker/murano/murano-engine/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-murano-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY config-external.sh /opt/kolla/
+COPY start.sh /
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/murano/murano-engine/config-external.sh b/docker/murano/murano-engine/config-external.sh
new file mode 100644
index 000000000..5d9a2da49
--- /dev/null
+++ b/docker/murano/murano-engine/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/murano/murano.conf"
+TARGET="/etc/murano/murano.conf"
+OWNER="murano"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/murano/murano-engine/start.sh b/docker/murano/murano-engine/start.sh
new file mode 100755
index 000000000..22834fc4c
--- /dev/null
+++ b/docker/murano/murano-engine/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/murano-engine"
+ARGS="--config-file /etc/murano/murano.conf"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/neutron/neutron-agents/Dockerfile.j2 b/docker/neutron/neutron-agents/Dockerfile.j2
new file mode 100644
index 000000000..590443e00
--- /dev/null
+++ b/docker/neutron/neutron-agents/Dockerfile.j2
@@ -0,0 +1,35 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-neutron-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum install -y supervisor \
+ && yum clean all
+
+COPY supervisord.conf /etc/
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends supervisor \
+ && apt-get clean
+
+COPY supervisord.conf /etc/supervisor/
+
+{% endif %}
+
+# TODO: SamYaple FWaaS is part of the l3-agent, not a seperate agent that is
+# why this file is needed. To support FWaaS we cannot have a seperate container
+# I need to figure out the best way to make this work together
+#
+# This file _does_ _not_ need to exist, you must remove referencing it from the
+# exec line in the start script. Also all these config options can exist in the
+# main neutron.conf if we wish
+COPY fwaas_driver.ini /etc/neutron/
+
+COPY neutron-dhcp-agent/ /opt/kolla/neutron-dhcp-agent
+COPY neutron-l3-agent/ /opt/kolla/neutron-l3-agent
+COPY neutron-metadata-agent/ /opt/kolla/neutron-metadata-agent
+
+CMD ["/usr/bin/supervisord"]
+
+{{ include_footer }}
diff --git a/docker/neutron/neutron-agents/fwaas_driver.ini b/docker/neutron/neutron-agents/fwaas_driver.ini
new file mode 120000
index 000000000..a9b1ec519
--- /dev/null
+++ b/docker/neutron/neutron-agents/fwaas_driver.ini
@@ -0,0 +1 @@
+neutron-l3-agent/fwaas_driver.ini \ No newline at end of file
diff --git a/docker/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh b/docker/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh
new file mode 100755
index 000000000..badbd86a1
--- /dev/null
+++ b/docker/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/dhcp_agent.ini /opt/kolla/neutron-agents/dnsmasq.conf"
+TARGET="/etc/neutron/"
+OWNER="neutron"
+
+for f in $SOURCES; do
+ if [[ -f "$f" ]]; then
+ fname=$(basename $f)
+ cp $f $TARGET
+ chown ${OWNER}: $TARGET/$fname
+ chmod 0644 $TARGET/$fname
+ fi
+done
diff --git a/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh b/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh
new file mode 100755
index 000000000..7b64f87aa
--- /dev/null
+++ b/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/neutron-dhcp-agent"
+ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+source /opt/kolla/config-sudoers.sh
+
+# Override set_configs() here because it doesn't work for fat containers like
+# this one.
+set_configs() {
+ case $KOLLA_CONFIG_STRATEGY in
+ CONFIG_EXTERNAL_COPY_ALWAYS)
+ source /opt/kolla/neutron-dhcp-agent/config-external.sh
+ ;;
+ CONFIG_EXTERNAL_COPY_ONCE)
+ if [[ -f /configured-dhcp ]]; then
+ echo 'INFO - Neutron-dhcp has already been configured; Refusing to copy new configs'
+ return
+ fi
+ source /opt/kolla/neutron-dhcp-agent/config-external.sh
+ touch /configured-dhcp
+ ;;
+
+ *)
+ echo '$KOLLA_CONFIG_STRATEGY is not set properly'
+ exit 1
+ ;;
+ esac
+}
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/neutron/neutron-agents/neutron-l3-agent/config-external.sh b/docker/neutron/neutron-agents/neutron-l3-agent/config-external.sh
new file mode 100755
index 000000000..e6eb049a4
--- /dev/null
+++ b/docker/neutron/neutron-agents/neutron-l3-agent/config-external.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/l3_agent.ini /opt/kolla/neutron-agents/fwaas_driver.ini"
+TARGET="/etc/neutron/"
+OWNER="neutron"
+
+for f in $SOURCES; do
+ if [[ -f "$f" ]]; then
+ fname=$(basename $f)
+ cp $f $TARGET
+ chown ${OWNER}: $TARGET/$fname
+ chmod 0644 $TARGET/$fname
+ fi
+done
+
+SOURCE="/opt/kolla/neutron-agents/ml2_conf.ini"
+TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini"
+OWNER="neutron"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini b/docker/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini
new file mode 100644
index 000000000..41f761abf
--- /dev/null
+++ b/docker/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini
@@ -0,0 +1,3 @@
+[fwaas]
+#driver = neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver
+#enabled = True
diff --git a/docker/neutron/neutron-agents/neutron-l3-agent/start.sh b/docker/neutron/neutron-agents/neutron-l3-agent/start.sh
new file mode 100755
index 000000000..e0a17e47a
--- /dev/null
+++ b/docker/neutron/neutron-agents/neutron-l3-agent/start.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/neutron-l3-agent"
+ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+source /opt/kolla/config-sudoers.sh
+
+# Override set_configs() here because it doesn't work for fat containers like
+# this one.
+set_configs() {
+ case $KOLLA_CONFIG_STRATEGY in
+ CONFIG_EXTERNAL_COPY_ALWAYS)
+ source /opt/kolla/neutron-l3-agent/config-external.sh
+ ;;
+ CONFIG_EXTERNAL_COPY_ONCE)
+ if [[ -f /configured-l3 ]]; then
+ echo 'INFO - Neutron-l3 has already been configured; Refusing to copy new configs'
+ return
+ fi
+ source /opt/kolla/neutron-l3-agent/config-external.sh
+ touch /configured-l3
+ ;;
+
+ *)
+ echo '$KOLLA_CONFIG_STRATEGY is not set properly'
+ exit 1
+ ;;
+ esac
+}
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/neutron/neutron-agents/neutron-metadata-agent/config-external.sh b/docker/neutron/neutron-agents/neutron-metadata-agent/config-external.sh
new file mode 100755
index 000000000..319ee3793
--- /dev/null
+++ b/docker/neutron/neutron-agents/neutron-metadata-agent/config-external.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/metadata_agent.ini"
+TARGET="/etc/neutron/"
+OWNER="neutron"
+
+for f in $SOURCES; do
+ if [[ -f "$f" ]]; then
+ fname=$(basename $f)
+ cp $f $TARGET
+ chown ${OWNER}: $TARGET/$fname
+ chmod 0644 $TARGET/$fname
+ fi
+done
diff --git a/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh b/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh
new file mode 100755
index 000000000..09a7329c7
--- /dev/null
+++ b/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/neutron-metadata-agent"
+ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+source /opt/kolla/config-sudoers.sh
+
+# Override set_configs() here because it doesn't work for fat containers like
+# this one.
+set_configs() {
+ case $KOLLA_CONFIG_STRATEGY in
+ CONFIG_EXTERNAL_COPY_ALWAYS)
+ source /opt/kolla/neutron-metadata-agent/config-external.sh
+ ;;
+ CONFIG_EXTERNAL_COPY_ONCE)
+ if [[ -f /configured-md ]]; then
+ echo 'INFO - Neutron-metadata has already been configured; Refusing to copy new configs'
+ return
+ fi
+ source /opt/kolla/neutron-metadata-agent/config-external.sh
+ touch /configured-md
+ ;;
+
+ *)
+ echo '$KOLLA_CONFIG_STRATEGY is not set properly'
+ exit 1
+ ;;
+ esac
+}
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/neutron/neutron-agents/supervisord.conf b/docker/neutron/neutron-agents/supervisord.conf
new file mode 100644
index 000000000..5cab8f5dc
--- /dev/null
+++ b/docker/neutron/neutron-agents/supervisord.conf
@@ -0,0 +1,40 @@
+[unix_http_server]
+file = /var/run/supervisor.sock
+
+[inet_http_server]
+port = 127.0.0.1:9001
+
+[supervisord]
+nodaemon=true
+logfile = /var/log/supervisor/supervisord.log
+logfile_maxbytes = 200KB
+logfile_backups = 1
+pidfile = /var/run/supervisord.pid
+childlogdir = /var/log/supervisor
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[supervisorctl]
+serverurl = unix:///var/run/supervisor.sock
+
+[program:neutron-dhcp-agent]
+command=/opt/kolla/neutron-dhcp-agent/start.sh
+priority=40
+startsec=10
+stderr_events_enabled=true
+stdout_events_enabled=true
+
+[program:neutron-metadata-agent]
+command=/opt/kolla/neutron-metadata-agent/start.sh
+priority=40
+startsec=10
+stderr_events_enabled=true
+stdout_events_enabled=true
+
+[program:neutron-l3-agent]
+command=/opt/kolla/neutron-l3-agent/start.sh
+priority=40
+startsec=10
+stderr_events_enabled=true
+stdout_events_enabled=true
diff --git a/docker/neutron/neutron-base/Dockerfile.j2 b/docker/neutron/neutron-base/Dockerfile.j2
new file mode 100644
index 000000000..f1cd75a37
--- /dev/null
+++ b/docker/neutron/neutron-base/Dockerfile.j2
@@ -0,0 +1,47 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install openstack-neutron \
+ openstack-neutron-ml2 \
+ openvswitch \
+ && yum clean all
+
+# TODO (sdake): remove once RDO adds to the openstack-neutron package
+RUN pip install oslo.versionedobjects
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type}} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ iptables \
+ dnsmasq \
+ uuid-runtime \
+ ipset \
+ openvswitch-switch \
+ && apt-get clean
+
+ {% endif %}
+
+ADD neutron.tar /
+RUN ln -s /neutron-* neutron \
+ && useradd --user-group neutron \
+ && pip --no-cache-dir install /neutron \
+ && mkdir -p /etc/neutron /usr/share/neutron /var/log/neutron /home/neutron \
+ && cp -r /neutron/etc/* /etc/neutron/ \
+ && cp -r /neutron/etc/neutron/* /etc/neutron/ \
+ && cp /neutron/etc/api-paste.ini /usr/share/neutron \
+ && mv /etc/neutron/neutron/ /etc/neutron/plugins/ \
+ && chown -R neutron: /etc/neutron /usr/share/neutron /var/log/neutron /home/neutron
+
+{% endif %}
+
+COPY config-sudoers.sh /opt/kolla/
diff --git a/docker/neutron/neutron-base/config-sudoers.sh b/docker/neutron/neutron-base/config-sudoers.sh
new file mode 100644
index 000000000..82cf0d624
--- /dev/null
+++ b/docker/neutron/neutron-base/config-sudoers.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Neutron uses rootwrap which requires a tty for sudo.
+# Since the container is running in daemon mode, a tty
+# is not present and requiretty must be commented out.
+if [ ! -f /sudo-modified ]; then
+ chmod 0640 /etc/sudoers
+ sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers
+ chmod 0440 /etc/sudoers
+fi
+
+touch /sudo-modified
diff --git a/docker/neutron/neutron-base/ip_wrapper.py b/docker/neutron/neutron-base/ip_wrapper.py
new file mode 100755
index 000000000..591fca6f4
--- /dev/null
+++ b/docker/neutron/neutron-base/ip_wrapper.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+# Copyright 2015 Sam Yaple
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file exists because we want to create and delete any network
+# namespaces from the host mount namespace. This allows the host to
+# access all of the neutron network namespaces as well as all
+# containers that bind mount /run/netns from the host.
+
+# This is required for "thin" neutron containers to function properly
+
+import nsenter
+import subprocess
+import sys
+
+
+def host_mnt_exec(cmd):
+ try:
+ with nsenter.ExitStack() as stack:
+ stack.enter_context(
+ nsenter.Namespace(
+ '1',
+ 'mnt',
+ proc='/opt/kolla/host_proc/'))
+ process_ = subprocess.Popen(cmd)
+
+ except Exception as e:
+ print(
+ "An error has occured with a component that Kolla manages."
+ " Please file a bug")
+ print("Error: ", e)
+
+ return process_
+
+
+if len(sys.argv) > 2:
+ # We catch all commands that ip will accept that refer
+ # to creating or deleteing a Network namespace
+ if str(sys.argv[1]).startswith("net") and (
+ str(sys.argv[2]).startswith("a") or
+ str(sys.argv[2]).startswith("d")):
+ # This cmd is executed in the host mount namespace
+ cmd = ["/usr/bin/env", "ip"] + sys.argv[1:]
+ sys.exit(host_mnt_exec(cmd).returncode)
+ else:
+ cmd = ["/opt/kolla/ip"] + sys.argv[1:]
+else:
+ cmd = ["/opt/kolla/ip"]
+
+ if len(sys.argv) == 2:
+ cmd = cmd + sys.argv[1:]
+
+process_ = subprocess.Popen(cmd)
+sys.exit(process_.returncode)
diff --git a/docker/neutron/neutron-linuxbridge-agent/Dockerfile.j2 b/docker/neutron/neutron-linuxbridge-agent/Dockerfile.j2
new file mode 100644
index 000000000..58d5ae6c3
--- /dev/null
+++ b/docker/neutron/neutron-linuxbridge-agent/Dockerfile.j2
@@ -0,0 +1,28 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-neutron-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+# Install required packages
+RUN yum install -y \
+ ebtables \
+ openstack-neutron-linuxbridge \
+ && yum clean all
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+# Install required packages
+RUN yum install -y ebtables && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/neutron/neutron-linuxbridge-agent/config-external.sh b/docker/neutron/neutron-linuxbridge-agent/config-external.sh
new file mode 100755
index 000000000..c44d71d84
--- /dev/null
+++ b/docker/neutron/neutron-linuxbridge-agent/config-external.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+SOURCE="/opt/kolla/neutron-linuxbridge-agent/neutron.conf"
+TARGET="/etc/neutron/neutron.conf"
+OWNER="neutron"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
+
+SOURCE="/opt/kolla/neutron-linuxbridge-agent/ml2_conf.ini"
+TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini"
+OWNER="neutron"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/neutron/neutron-linuxbridge-agent/start.sh b/docker/neutron/neutron-linuxbridge-agent/start.sh
new file mode 100755
index 000000000..ab47f2dfb
--- /dev/null
+++ b/docker/neutron/neutron-linuxbridge-agent/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/neutron-linuxbridge-agent"
+ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+source /opt/kolla/config-sudoers.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2 b/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2
new file mode 100644
index 000000000..ad12e5511
--- /dev/null
+++ b/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2
@@ -0,0 +1,32 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-neutron-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+# Install required packages
+RUN yum install -y \
+ openstack-neutron-openvswitch \
+ openvswitch \
+ && yum clean all
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+# Install required packages
+RUN yum install -y \
+ #TODO: will be addressed later
+ https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm \
+ openvswitch \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/neutron/neutron-openvswitch-agent/config-external.sh b/docker/neutron/neutron-openvswitch-agent/config-external.sh
new file mode 100755
index 000000000..552d69861
--- /dev/null
+++ b/docker/neutron/neutron-openvswitch-agent/config-external.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+SOURCE="/opt/kolla/neutron-openvswitch-agent/neutron.conf"
+TARGET="/etc/neutron/neutron.conf"
+OWNER="neutron"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
+
+SOURCE="/opt/kolla/neutron-openvswitch-agent/ml2_conf.ini"
+TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini"
+OWNER="neutron"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/neutron/neutron-openvswitch-agent/start.sh b/docker/neutron/neutron-openvswitch-agent/start.sh
new file mode 100755
index 000000000..6d62ff65d
--- /dev/null
+++ b/docker/neutron/neutron-openvswitch-agent/start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/neutron-openvswitch-agent"
+ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+source /opt/kolla/config-sudoers.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/neutron/neutron-server/Dockerfile.j2 b/docker/neutron/neutron-server/Dockerfile.j2
new file mode 100644
index 000000000..9cfe634c4
--- /dev/null
+++ b/docker/neutron/neutron-server/Dockerfile.j2
@@ -0,0 +1,31 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-neutron-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+# Install required packages
+RUN yum install -y which \
+ && yum clean all
+
+# See bug: https://bugs.launchpad.net/kolla/+bug/1483667
+# TODO(SamYaple): Check in on this and remove once unneccesary
+RUN pip install oslo.messaging==2.2.0
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+#Install required packages
+RUN yum install -y which \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/neutron/neutron-server/config-external.sh b/docker/neutron/neutron-server/config-external.sh
new file mode 100755
index 000000000..574923067
--- /dev/null
+++ b/docker/neutron/neutron-server/config-external.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+SOURCE="/opt/kolla/neutron-server/neutron.conf"
+TARGET="/etc/neutron/neutron.conf"
+OWNER="neutron"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
+
+SOURCE="/opt/kolla/neutron-server/ml2_conf.ini"
+TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini"
+OWNER="neutron"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/neutron/neutron-server/start.sh b/docker/neutron/neutron-server/start.sh
new file mode 100755
index 000000000..51c4c2a3d
--- /dev/null
+++ b/docker/neutron/neutron-server/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/neutron-server"
+ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/bash -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/nova/nova-api/Dockerfile.j2 b/docker/nova/nova-api/Dockerfile.j2
new file mode 100644
index 000000000..b906d1937
--- /dev/null
+++ b/docker/nova/nova-api/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-nova-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-nova-api \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/nova/nova-api/config-external.sh b/docker/nova/nova-api/config-external.sh
new file mode 100755
index 000000000..d0859893d
--- /dev/null
+++ b/docker/nova/nova-api/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/nova-api/nova.conf"
+TARGET="/etc/nova/nova.conf"
+OWNER="nova"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/nova/nova-api/start.sh b/docker/nova/nova-api/start.sh
new file mode 100755
index 000000000..ad25ba65c
--- /dev/null
+++ b/docker/nova/nova-api/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/nova-api"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "nova-manage db sync" nova
+ exit 0
+fi
+
+exec $CMD $ARGS
diff --git a/docker/nova/nova-base/Dockerfile.j2 b/docker/nova/nova-base/Dockerfile.j2
new file mode 100644
index 000000000..b46a446d4
--- /dev/null
+++ b/docker/nova/nova-base/Dockerfile.j2
@@ -0,0 +1,50 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-nova-common \
+ python-keystoneclient \
+ python-cinderclient \
+ python-nova \
+ bridge-utils \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ bridge-utils \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ iptables \
+ ebtables \
+ dnsmasq \
+ bridge-utils \
+ python-libvirt \
+ openssh-client \
+ openvswitch-switch \
+ && apt-get clean
+
+ {% endif %}
+
+ADD nova.tar /
+RUN ln -s /nova-* nova \
+ && useradd --user-group nova \
+ && pip --no-cache-dir install /nova \
+ && mkdir -p /etc/nova /var/log/nova /home/nova \
+ && cp -r /nova/etc/nova/* /etc/nova/ \
+ && chown -R nova: /etc/nova /var/log/nova /home/nova
+
+{% endif %}
diff --git a/docker/nova/nova-compute/Dockerfile.j2 b/docker/nova/nova-compute/Dockerfile.j2
new file mode 100644
index 000000000..a8a719023
--- /dev/null
+++ b/docker/nova/nova-compute/Dockerfile.j2
@@ -0,0 +1,34 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-nova-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-nova-compute \
+ openvswitch \
+ sysfsutils \
+ && yum clean all
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ sysfsutils \
+ libvirt-python \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends qemu-utils \
+ && apt-get clean
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/nova/nova-compute/config-external.sh b/docker/nova/nova-compute/config-external.sh
new file mode 100755
index 000000000..e844bf50c
--- /dev/null
+++ b/docker/nova/nova-compute/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/nova-compute/nova.conf"
+TARGET="/etc/nova/nova.conf"
+OWNER="nova"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/nova/nova-compute/start.sh b/docker/nova/nova-compute/start.sh
new file mode 100755
index 000000000..48e77542b
--- /dev/null
+++ b/docker/nova/nova-compute/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/nova-compute"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/nova/nova-conductor/Dockerfile.j2 b/docker/nova/nova-conductor/Dockerfile.j2
new file mode 100644
index 000000000..0f42df5c9
--- /dev/null
+++ b/docker/nova/nova-conductor/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-nova-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-nova-conductor \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/nova/nova-conductor/config-external.sh b/docker/nova/nova-conductor/config-external.sh
new file mode 100755
index 000000000..ea3b123ec
--- /dev/null
+++ b/docker/nova/nova-conductor/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/nova-conductor/nova.conf"
+TARGET="/etc/nova/nova.conf"
+OWNER="nova"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/nova/nova-conductor/start.sh b/docker/nova/nova-conductor/start.sh
new file mode 100755
index 000000000..1fe7d0586
--- /dev/null
+++ b/docker/nova/nova-conductor/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/nova-conductor"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/nova/nova-consoleauth/Dockerfile.j2 b/docker/nova/nova-consoleauth/Dockerfile.j2
new file mode 100644
index 000000000..1c8d9ea12
--- /dev/null
+++ b/docker/nova/nova-consoleauth/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-nova-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-nova-console \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/nova/nova-consoleauth/config-external.sh b/docker/nova/nova-consoleauth/config-external.sh
new file mode 100755
index 000000000..1da10d83f
--- /dev/null
+++ b/docker/nova/nova-consoleauth/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/nova-consoleauth/nova.conf"
+TARGET="/etc/nova/nova.conf"
+OWNER="nova"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/nova/nova-consoleauth/start.sh b/docker/nova/nova-consoleauth/start.sh
new file mode 100755
index 000000000..1abccde19
--- /dev/null
+++ b/docker/nova/nova-consoleauth/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/nova-consoleauth"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/nova/nova-libvirt/Dockerfile.j2 b/docker/nova/nova-libvirt/Dockerfile.j2
new file mode 100644
index 000000000..5ff525426
--- /dev/null
+++ b/docker/nova/nova-libvirt/Dockerfile.j2
@@ -0,0 +1,32 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-nova-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ libvirt-daemon \
+ libguestfs \
+ qemu-system-x86 \
+ libvirt-daemon-driver-nwfilter \
+ libvirt-daemon-config-nwfilter \
+ libvirt-daemon-driver-lxc \
+ && yum clean all
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ libvirt-bin \
+ dmidecode \
+ pm-utils \
+ qemu \
+ ebtables \
+ && apt-get clean
+
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/nova/nova-libvirt/config-external.sh b/docker/nova/nova-libvirt/config-external.sh
new file mode 100755
index 000000000..acc1c5473
--- /dev/null
+++ b/docker/nova/nova-libvirt/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/libvirt/libvirtd.conf"
+TARGET="/etc/libvirt/libvirtd.conf"
+OWNER="libvirt"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/nova/nova-libvirt/start.sh b/docker/nova/nova-libvirt/start.sh
new file mode 100755
index 000000000..ae0de867b
--- /dev/null
+++ b/docker/nova/nova-libvirt/start.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/sbin/libvirtd"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# TODO(SamYaple): Tweak libvirt.conf rather than change permissions.
+# Fix permissions for libvirt
+if [[ -c /dev/kvm ]]; then
+ chmod 660 /dev/kvm
+ chown root:kvm /dev/kvm
+fi
+
+exec $CMD $ARGS
diff --git a/docker/nova/nova-network/Dockerfile.j2 b/docker/nova/nova-network/Dockerfile.j2
new file mode 100644
index 000000000..60ea394aa
--- /dev/null
+++ b/docker/nova/nova-network/Dockerfile.j2
@@ -0,0 +1,28 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-nova-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-nova-network \
+ bridge-utils \
+ initscripts \
+ && yum clean all
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install initscripts \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/nova/nova-network/config-external.sh b/docker/nova/nova-network/config-external.sh
new file mode 100755
index 000000000..7c1d6bb37
--- /dev/null
+++ b/docker/nova/nova-network/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/nova-network/nova.conf"
+TARGET="/etc/nova/nova.conf"
+OWNER="nova"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/nova/nova-network/start.sh b/docker/nova/nova-network/start.sh
new file mode 100755
index 000000000..88f941b33
--- /dev/null
+++ b/docker/nova/nova-network/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/nova-network"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/nova/nova-novncproxy/Dockerfile.j2 b/docker/nova/nova-novncproxy/Dockerfile.j2
new file mode 100644
index 000000000..b798e00a6
--- /dev/null
+++ b/docker/nova/nova-novncproxy/Dockerfile.j2
@@ -0,0 +1,34 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-nova-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ novnc \
+ openstack-nova-novncproxy \
+ && yum clean all
+
+ {% endif %}
+{% elif install_type == 'source' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm \
+ novnc \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+ADD novnc.tar /
+RUN ln -s /kanaka-noVNC-* /usr/share/novnc
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/nova/nova-novncproxy/config-external.sh b/docker/nova/nova-novncproxy/config-external.sh
new file mode 100755
index 000000000..fdc33a5bd
--- /dev/null
+++ b/docker/nova/nova-novncproxy/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/nova-novncproxy/nova.conf"
+TARGET="/etc/nova/nova.conf"
+OWNER="nova"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/nova/nova-novncproxy/start.sh b/docker/nova/nova-novncproxy/start.sh
new file mode 100755
index 000000000..6e59d1253
--- /dev/null
+++ b/docker/nova/nova-novncproxy/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/nova-novncproxy"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/nova/nova-scheduler/Dockerfile.j2 b/docker/nova/nova-scheduler/Dockerfile.j2
new file mode 100644
index 000000000..5dd0fd507
--- /dev/null
+++ b/docker/nova/nova-scheduler/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-nova-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-nova-scheduler \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/nova/nova-scheduler/config-external.sh b/docker/nova/nova-scheduler/config-external.sh
new file mode 100755
index 000000000..3df0f9b7b
--- /dev/null
+++ b/docker/nova/nova-scheduler/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/nova-scheduler/nova.conf"
+TARGET="/etc/nova/nova.conf"
+OWNER="nova"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/nova/nova-scheduler/start.sh b/docker/nova/nova-scheduler/start.sh
new file mode 100755
index 000000000..d9b3e14eb
--- /dev/null
+++ b/docker/nova/nova-scheduler/start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -o errexit
+
+CMD="/usr/bin/nova-scheduler"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/openvswitch/ovs-base/Dockerfile.j2 b/docker/openvswitch/ovs-base/Dockerfile.j2
new file mode 100644
index 000000000..fd8eac1af
--- /dev/null
+++ b/docker/openvswitch/ovs-base/Dockerfile.j2
@@ -0,0 +1,22 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+ {% if install_type == 'source' %}
+
+ # TODO(sdake): groan openvswitch is only in the RDO repos
+RUN yum install -y https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm \
+ && yum clean all
+
+ {% endif %}
+
+RUN yum install -y \
+ openvswitch \
+ && yum clean all
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends openvswitch-switch \
+ && apt-get clean
+
+{% endif %}
diff --git a/docker/openvswitch/ovs-db-server/Dockerfile.j2 b/docker/openvswitch/ovs-db-server/Dockerfile.j2
new file mode 100644
index 000000000..05c6a928b
--- /dev/null
+++ b/docker/openvswitch/ovs-db-server/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ovs-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/openvswitch/ovs-db-server/config-external.sh b/docker/openvswitch/ovs-db-server/config-external.sh
new file mode 100644
index 000000000..9ada4efcb
--- /dev/null
+++ b/docker/openvswitch/ovs-db-server/config-external.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+#This file should be a noop. It just needs to exist, but it don't perform any function
diff --git a/docker/openvswitch/ovs-db-server/start.sh b/docker/openvswitch/ovs-db-server/start.sh
new file mode 100755
index 000000000..89b2e3e92
--- /dev/null
+++ b/docker/openvswitch/ovs-db-server/start.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -o errexit
+
+LOG_FILE="/var/log/openvswitch/ovsdb-server.log"
+DB_FILE="/etc/openvswitch/conf.db"
+UNIXSOCK_DIR="/var/run/openvswitch"
+UNIXSOCK="${UNIXSOCK_DIR}/db.sock"
+
+CMD="/usr/sbin/ovsdb-server"
+ARGS="$DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:${UNIXSOCK} --log-file=${LOG_FILE}"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+mkdir -p "${UNIXSOCK_DIR}"
+
+if [[ ! -e "${DB_FILE}" ]]; then
+ ovsdb-tool create "${DB_FILE}"
+fi
+
+exec $CMD $ARGS
diff --git a/docker/openvswitch/ovs-vswitchd/Dockerfile.j2 b/docker/openvswitch/ovs-vswitchd/Dockerfile.j2
new file mode 100644
index 000000000..59079d335
--- /dev/null
+++ b/docker/openvswitch/ovs-vswitchd/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-ovs-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY start.sh /
+COPY ovs_ensure_configured.sh config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/openvswitch/ovs-vswitchd/config-external.sh b/docker/openvswitch/ovs-vswitchd/config-external.sh
new file mode 100644
index 000000000..9ada4efcb
--- /dev/null
+++ b/docker/openvswitch/ovs-vswitchd/config-external.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+#This file should be a noop. It just needs to exist, but it don't perform any function
diff --git a/docker/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh b/docker/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh
new file mode 100755
index 000000000..c39d64ff7
--- /dev/null
+++ b/docker/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+bridge=$1
+port=$2
+
+ovs-vsctl br-exists $bridge; rc=$?
+if [[ $rc == 2 ]]; then
+ changed=changed
+ ovs-vsctl add-br $bridge
+fi
+
+if [[ ! $(ovs-vsctl list-ports $bridge) =~ $(echo "\<$port\>") ]]; then
+ changed=changed
+ ovs-vsctl add-port $bridge $port
+fi
+
+echo $changed
diff --git a/docker/openvswitch/ovs-vswitchd/start.sh b/docker/openvswitch/ovs-vswitchd/start.sh
new file mode 100755
index 000000000..3ec2c26b2
--- /dev/null
+++ b/docker/openvswitch/ovs-vswitchd/start.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+LOG_FILE="/var/log/openvswitch/ovs-vswitchd.log"
+DB_FILE="/etc/openvswitch/conf.db"
+UNIXSOCK_DIR="/var/run/openvswitch"
+UNIXSOCK="${UNIXSOCK_DIR}/db.sock"
+
+CMD="/usr/sbin/ovs-vswitchd"
+ARGS="unix:${UNIXSOCK} -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file=${LOG_FILE}"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+modprobe openvswitch
+mkdir -p "${UNIXSOCK_DIR}"
+
+exec $CMD $ARGS
diff --git a/docker/rabbitmq/Dockerfile.j2 b/docker/rabbitmq/Dockerfile.j2
new file mode 100644
index 000000000..1baf2ce80
--- /dev/null
+++ b/docker/rabbitmq/Dockerfile.j2
@@ -0,0 +1,27 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install \
+ hostname \
+ rabbitmq-server \
+ && yum clean all \
+ && rm -rf /var/lib/rabbitmq/*
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get install -y --no-install-recommends rabbitmq-server \
+ && apt-get clean \
+ && rm -rf /var/lib/rabbitmq/*
+
+{% endif %}
+
+RUN /usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management
+
+COPY start.sh /
+COPY config-rabbit.sh config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/rabbitmq/config-external.sh b/docker/rabbitmq/config-external.sh
new file mode 100644
index 000000000..33810d621
--- /dev/null
+++ b/docker/rabbitmq/config-external.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+SOURCE_CONFIG="/opt/kolla/rabbitmq/rabbitmq.config"
+TARGET_CONFIG="/etc/rabbitmq/rabbitmq.config"
+SOURCE_ENV="/opt/kolla/rabbitmq/rabbitmq-env.conf"
+TARGET_ENV="/etc/rabbitmq/rabbitmq-env.conf"
+OWNER="rabbitmq"
+
+# Cluster configuration
+if [[ -f "$SOURCE_CONFIG" ]]; then
+ cp -af $SOURCE_CONFIG $TARGET_CONFIG
+ chown ${OWNER}: $TARGET_CONFIG
+ chmod 0600 $TARGET_CONFIG
+fi
+
+if [[ -f "$SOURCE_ENV" ]]; then
+ cp -af $SOURCE_ENV $TARGET_ENV
+ chown ${OWNER}: $TARGET_ENV
+ chmod 0600 $TARGET_ENV
+fi
diff --git a/docker/rabbitmq/config-rabbit.sh b/docker/rabbitmq/config-rabbit.sh
new file mode 100644
index 000000000..c87a2ab48
--- /dev/null
+++ b/docker/rabbitmq/config-rabbit.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+function set_rabbitmq_cookie {
+ echo "${RABBITMQ_CLUSTER_COOKIE}" > /var/lib/rabbitmq/.erlang.cookie
+ chown -R rabbitmq: /var/lib/rabbitmq
+ chmod 400 /var/lib/rabbitmq/.erlang.cookie
+}
diff --git a/docker/rabbitmq/start.sh b/docker/rabbitmq/start.sh
new file mode 100755
index 000000000..749bee963
--- /dev/null
+++ b/docker/rabbitmq/start.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/sbin/rabbitmq-server"
+ARGS=""
+
+# loading common functions
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# loading functions
+source /opt/kolla/config-rabbit.sh
+
+# This catches all cases of the BOOTSTRAP variable being set, including empty
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ set_rabbitmq_cookie
+ exit 0
+fi
+
+$CMD $ARGS
diff --git a/docker/swift/swift-account-server/Dockerfile.j2 b/docker/swift/swift-account-server/Dockerfile.j2
new file mode 100644
index 000000000..7320de9f4
--- /dev/null
+++ b/docker/swift/swift-account-server/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-swift-account \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-account-server/config-external.sh b/docker/swift/swift-account-server/config-external.sh
new file mode 100644
index 000000000..61adefcd0
--- /dev/null
+++ b/docker/swift/swift-account-server/config-external.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+if [[ -f /opt/kolla/swift/swift.conf ]]; then
+ cp /opt/kolla/swift/swift.conf /etc/swift/
+ chown swift: /etc/swift/swift.conf
+ chmod 0640 /etc/swift/swift.conf
+fi
+
+if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then
+ cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz
+ chown swift: /etc/swift/account.ring.gz
+ chmod 0640 /etc/swift/account.ring.gz
+fi
+
+if [[ -f /opt/kolla/swift-account-server/account-server.conf ]]; then
+ cp /opt/kolla/swift-account-server/account-server.conf /etc/swift/
+ chown swift: /etc/swift/account-server.conf
+ chmod 0640 /etc/swift/account-server.conf
+fi
diff --git a/docker/swift/swift-account-server/start.sh b/docker/swift/swift-account-server/start.sh
new file mode 100755
index 000000000..402ee6f44
--- /dev/null
+++ b/docker/swift/swift-account-server/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-account-server"
+ARGS="/etc/swift/account-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/swift/swift-base/Dockerfile.j2 b/docker/swift/swift-base/Dockerfile.j2
new file mode 100644
index 000000000..7102916f1
--- /dev/null
+++ b/docker/swift/swift-base/Dockerfile.j2
@@ -0,0 +1,29 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install openstack-swift && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type}} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+
+{% elif install_type == 'source' %}
+
+ADD swift.tar /
+RUN ln -s /swift-* swift \
+ && useradd --user-group swift \
+ && pip --no-cache-dir install /swift \
+ && mkdir -p /etc/swift /var/log/swift /home/swift \
+ && cp -r /swift/etc/* /etc/swift/ \
+ && chown -R swift: /etc/swift /var/log/swift /home/swift
+
+{% endif %}
+
+COPY config-swift.sh build-swift-ring.py /opt/kolla/
+RUN mkdir /opt/swift
diff --git a/docker/swift/swift-base/build-swift-ring.py b/docker/swift/swift-base/build-swift-ring.py
new file mode 100644
index 000000000..d7386392d
--- /dev/null
+++ b/docker/swift/swift-base/build-swift-ring.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+
+# Copyright 2015 Paul Bourke
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This script is a simple wrapper used to create and rebalance Swift ring files.
+"""
+
+import argparse
+import subprocess
+import sys
+
+
+def setup_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-f", "--ring-file",
+ required=True,
+ help="Path to ring file")
+ parser.add_argument("-p", "--part-power",
+ required=True,
+ help="Part power")
+ parser.add_argument("-r", "--num-replicas",
+ required=True,
+ help="Number of replicas")
+ parser.add_argument("-m", "--min-part-hours",
+ required=True,
+ help="Min part hours")
+ parser.add_argument("-H", "--hosts",
+ required=True,
+ help="Hosts in the ring, comma delimited")
+ parser.add_argument("-w", "--weights",
+ required=True,
+ help="Weight of each host, comma delimited")
+ parser.add_argument("-d", "--devices",
+ required=True,
+ help="Device on each host, comma delimited")
+ parser.add_argument("-z", "--zones",
+ required=True,
+ help="Zone of each host, comma delimited")
+ return parser.parse_args()
+
+
+def run_cmd(cmd):
+ print(' '.join(cmd))
+ subprocess.call(cmd)
+
+
+def run(args):
+ hosts = args.hosts.split(',')
+ weights = args.weights.split(',')
+ zones = args.zones.split(',')
+ devices = args.devices.split(',')
+ if not (len(hosts) == len(weights) == len(zones) == len(devices)):
+ print('Error: an equal amount of hosts, devices, weights, '
+ 'and zones are required')
+ sys.exit(1)
+
+ run_cmd(['/usr/bin/swift-ring-builder',
+ args.ring_file,
+ 'create',
+ args.part_power,
+ args.num_replicas,
+ args.min_part_hours])
+
+ for i in xrange(len(hosts)):
+ run_cmd(['/usr/bin/swift-ring-builder',
+ args.ring_file,
+ 'add',
+ 'z{}-{}/{}'.format(zones[i], hosts[i], devices[i]),
+ weights[i]])
+
+ run_cmd(['/usr/bin/swift-ring-builder', args.ring_file, 'rebalance'])
+
+
+def main():
+ args = setup_args()
+ run(args)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/docker/swift/swift-base/config-swift.sh b/docker/swift/swift-base/config-swift.sh
new file mode 100755
index 000000000..b101b4e69
--- /dev/null
+++ b/docker/swift/swift-base/config-swift.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+chown -R swift: /srv/node
diff --git a/docker/swift/swift-container-server/Dockerfile.j2 b/docker/swift/swift-container-server/Dockerfile.j2
new file mode 100644
index 000000000..1a08c0f5d
--- /dev/null
+++ b/docker/swift/swift-container-server/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-swift-container \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-container-server/config-external.sh b/docker/swift/swift-container-server/config-external.sh
new file mode 100644
index 000000000..d81ba6cc4
--- /dev/null
+++ b/docker/swift/swift-container-server/config-external.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+OWNER="swift"
+
+if [[ -f "/opt/kolla/swift/swift.conf" ]]; then
+ cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf
+ chown ${OWNER}: /etc/swift/swift.conf
+ chmod 0640 /etc/swift/swift.conf
+fi
+
+if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then
+ cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz
+ chown ${OWNER}: /etc/swift/container.ring.gz
+ chmod 0640 /etc/swift/container.ring.gz
+fi
+
+if [[ -f "/opt/kolla/swift-container-server/container-server.conf" ]]; then
+ cp /opt/kolla/swift-container-server/container-server.conf /etc/swift/container-server.conf
+ chown ${OWNER}: /etc/swift/container-server.conf
+ chmod 0640 /etc/swift/container-server.conf
+fi
diff --git a/docker/swift/swift-container-server/start.sh b/docker/swift/swift-container-server/start.sh
new file mode 100755
index 000000000..78070ab29
--- /dev/null
+++ b/docker/swift/swift-container-server/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-container-server"
+ARGS="/etc/swift/container-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/swift/swift-object-auditor/Dockerfile.j2 b/docker/swift/swift-object-auditor/Dockerfile.j2
new file mode 100644
index 000000000..ab8a7adee
--- /dev/null
+++ b/docker/swift/swift-object-auditor/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-object-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-object-auditor/config-external.sh b/docker/swift/swift-object-auditor/config-external.sh
new file mode 100644
index 000000000..0fa02e985
--- /dev/null
+++ b/docker/swift/swift-object-auditor/config-external.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+SOURCE="/opt/kolla/swift/swift.conf"
+TARGET="/etc/swift/swift.conf"
+SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf"
+TARGET_OBJECT_SERVER="/etc/swift/object-server.conf"
+OWNER="swift"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0640 $TARGET
+fi
+
+if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then
+ cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER
+ chown ${OWNER}: $TARGET_OBJECT_SERVER
+ chmod 0640 $TARGET_OBJECT_SERVER
+fi
diff --git a/docker/swift/swift-object-auditor/start.sh b/docker/swift/swift-object-auditor/start.sh
new file mode 100755
index 000000000..6319eed6b
--- /dev/null
+++ b/docker/swift/swift-object-auditor/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-object-auditor"
+ARGS="/etc/swift/object-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/swift/swift-object-base/Dockerfile.j2 b/docker/swift/swift-object-base/Dockerfile.j2
new file mode 100644
index 000000000..54997a114
--- /dev/null
+++ b/docker/swift/swift-object-base/Dockerfile.j2
@@ -0,0 +1,14 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-swift-object \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY config-swift-object.sh /opt/kolla/
diff --git a/docker/swift/swift-object-base/config-swift-object.sh b/docker/swift/swift-object-base/config-swift-object.sh
new file mode 100644
index 000000000..0d3d58dc3
--- /dev/null
+++ b/docker/swift/swift-object-base/config-swift-object.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+. /opt/kolla/kolla-common.sh
+
+check_required_vars \
+ SWIFT_CONTAINER_SVC_RING_DEVICES \
+ SWIFT_CONTAINER_SVC_RING_HOSTS \
+ SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS \
+ SWIFT_CONTAINER_SVC_RING_NAME \
+ SWIFT_CONTAINER_SVC_RING_PART_POWER \
+ SWIFT_CONTAINER_SVC_RING_REPLICAS \
+ SWIFT_CONTAINER_SVC_RING_WEIGHTS \
+ SWIFT_CONTAINER_SVC_RING_ZONES \
+ SWIFT_DIR \
+ SWIFT_OBJECT_SVC_BIND_IP \
+ SWIFT_OBJECT_SVC_BIND_PORT \
+ SWIFT_OBJECT_SVC_DEVICES \
+ SWIFT_OBJECT_SVC_MOUNT_CHECK \
+ SWIFT_OBJECT_SVC_PIPELINE \
+ SWIFT_OBJECT_SVC_RING_DEVICES \
+ SWIFT_OBJECT_SVC_RING_HOSTS \
+ SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS \
+ SWIFT_OBJECT_SVC_RING_NAME \
+ SWIFT_OBJECT_SVC_RING_PART_POWER \
+ SWIFT_OBJECT_SVC_RING_REPLICAS \
+ SWIFT_OBJECT_SVC_RING_WEIGHTS \
+ SWIFT_OBJECT_SVC_RING_ZONES \
+ SWIFT_USER
+
+cfg=/etc/swift/object-server.conf
+
+crudini --set $cfg DEFAULT bind_ip "${SWIFT_OBJECT_SVC_BIND_IP}"
+crudini --set $cfg DEFAULT bind_port "${SWIFT_OBJECT_SVC_BIND_PORT}"
+crudini --set $cfg DEFAULT user "${SWIFT_USER}"
+crudini --set $cfg DEFAULT swift_dir "${SWIFT_DIR}"
+crudini --set $cfg DEFAULT devices "${SWIFT_OBJECT_SVC_DEVICES}"
+crudini --set $cfg DEFAULT mount_check "${SWIFT_OBJECT_SVC_MOUNT_CHECK}"
+
+crudini --set $cfg pipeline:main pipeline "${SWIFT_OBJECT_SVC_PIPELINE}"
+
+# NOTE(pbourke): some services require a section in the conf, even if empty
+crudini --set $cfg object-expirer
+
+# Create swift user and group if they don't exist
+id -u swift &>/dev/null || useradd --user-group swift
+
+# Ensure proper ownership of the mount point directory structure
+chown -R swift:swift /srv/node
+
+# TODO(pbourke): does this need to be on a data vol?
+mkdir -p /var/cache/swift
+chown -R swift:swift /var/cache/swift
+
+python /opt/kolla/build-swift-ring.py \
+ -f ${SWIFT_OBJECT_SVC_RING_NAME} \
+ -p ${SWIFT_OBJECT_SVC_RING_PART_POWER} \
+ -r ${SWIFT_OBJECT_SVC_RING_REPLICAS} \
+ -m ${SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS} \
+ -H ${SWIFT_OBJECT_SVC_RING_HOSTS} \
+ -w ${SWIFT_OBJECT_SVC_RING_WEIGHTS} \
+ -d ${SWIFT_OBJECT_SVC_RING_DEVICES} \
+ -z ${SWIFT_OBJECT_SVC_RING_ZONES}
+
+python /opt/kolla/build-swift-ring.py \
+ -f ${SWIFT_CONTAINER_SVC_RING_NAME} \
+ -p ${SWIFT_CONTAINER_SVC_RING_PART_POWER} \
+ -r ${SWIFT_CONTAINER_SVC_RING_REPLICAS} \
+ -m ${SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS} \
+ -H ${SWIFT_CONTAINER_SVC_RING_HOSTS} \
+ -w ${SWIFT_CONTAINER_SVC_RING_WEIGHTS} \
+ -d ${SWIFT_CONTAINER_SVC_RING_DEVICES} \
+ -z ${SWIFT_CONTAINER_SVC_RING_ZONES}
diff --git a/docker/swift/swift-object-expirer/Dockerfile.j2 b/docker/swift/swift-object-expirer/Dockerfile.j2
new file mode 100644
index 000000000..af9f3eb58
--- /dev/null
+++ b/docker/swift/swift-object-expirer/Dockerfile.j2
@@ -0,0 +1,20 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-object-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install \
+ openstack-swift-proxy \
+ openstack-swift-container \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-object-expirer/config-external.sh b/docker/swift/swift-object-expirer/config-external.sh
new file mode 100644
index 000000000..ff2bcf9f5
--- /dev/null
+++ b/docker/swift/swift-object-expirer/config-external.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+SOURCE="/opt/kolla/swift/swift.conf"
+TARGET="/etc/swift/swift.conf"
+SOURCE_OBJECT_EXPIRER="/opt/kolla/swift/object-expirer.conf"
+TARGET_OBJECT_EXPIRER="/etc/swift/object-expirer.conf"
+OWNER="swift"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0640 $TARGET
+fi
+
+if [[ -f "$SOURCE_OBJECT_EXPIRER" ]]; then
+ cp $SOURCE_OBJECT_EXPIRER $TARGET_OBJECT_EXPIRER
+ chown ${OWNER}: $TARGET_OBJECT_EXPIRER
+ chmod 0640 $TARGET_OBJECT_EXPIRER
+fi
diff --git a/docker/swift/swift-object-expirer/start.sh b/docker/swift/swift-object-expirer/start.sh
new file mode 100755
index 000000000..434e8dc49
--- /dev/null
+++ b/docker/swift/swift-object-expirer/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-object-expirer"
+ARGS="/etc/swift/object-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/swift/swift-object-replicator/Dockerfile.j2 b/docker/swift/swift-object-replicator/Dockerfile.j2
new file mode 100644
index 000000000..ab8a7adee
--- /dev/null
+++ b/docker/swift/swift-object-replicator/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-object-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-object-replicator/config-external.sh b/docker/swift/swift-object-replicator/config-external.sh
new file mode 100644
index 000000000..0fa02e985
--- /dev/null
+++ b/docker/swift/swift-object-replicator/config-external.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+SOURCE="/opt/kolla/swift/swift.conf"
+TARGET="/etc/swift/swift.conf"
+SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf"
+TARGET_OBJECT_SERVER="/etc/swift/object-server.conf"
+OWNER="swift"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0640 $TARGET
+fi
+
+if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then
+ cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER
+ chown ${OWNER}: $TARGET_OBJECT_SERVER
+ chmod 0640 $TARGET_OBJECT_SERVER
+fi
diff --git a/docker/swift/swift-object-replicator/start.sh b/docker/swift/swift-object-replicator/start.sh
new file mode 100755
index 000000000..203f8864d
--- /dev/null
+++ b/docker/swift/swift-object-replicator/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-object-replicator"
+ARGS="/etc/swift/object-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/swift/swift-object-server/Dockerfile.j2 b/docker/swift/swift-object-server/Dockerfile.j2
new file mode 100644
index 000000000..ab8a7adee
--- /dev/null
+++ b/docker/swift/swift-object-server/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-object-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-object-server/config-external.sh b/docker/swift/swift-object-server/config-external.sh
new file mode 100644
index 000000000..a3fb1a2cc
--- /dev/null
+++ b/docker/swift/swift-object-server/config-external.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+OWNER="swift"
+
+if [[ -f "/opt/kolla/swift/swift.conf" ]]; then
+ cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf
+ chown ${OWNER}: /etc/swift/swift.conf
+ chmod 0640 /etc/swift/swift.conf
+fi
+
+if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then
+ cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz
+ chown ${OWNER}: /etc/swift/object.ring.gz
+ chmod 0640 /etc/swift/object.ring.gz
+fi
+
+if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then
+ cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz
+ chown ${OWNER}: /etc/swift/container.ring.gz
+ chmod 0640 /etc/swift/container.ring.gz
+fi
+
+if [[ -f "/opt/kolla/swift-object-server/object-server.conf" ]]; then
+ cp /opt/kolla/swift-object-server/object-server.conf /etc/swift/object-server.conf
+ chown ${OWNER}: /etc/swift/object-server.conf
+ chmod 0640 /etc/swift/object-server.conf
+fi
diff --git a/docker/swift/swift-object-server/start.sh b/docker/swift/swift-object-server/start.sh
new file mode 100755
index 000000000..f2a32b4d3
--- /dev/null
+++ b/docker/swift/swift-object-server/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-object-server"
+ARGS="/etc/swift/object-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/swift/swift-object-updater/Dockerfile.j2 b/docker/swift/swift-object-updater/Dockerfile.j2
new file mode 100644
index 000000000..ab8a7adee
--- /dev/null
+++ b/docker/swift/swift-object-updater/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-object-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-object-updater/config-external.sh b/docker/swift/swift-object-updater/config-external.sh
new file mode 100644
index 000000000..0fa02e985
--- /dev/null
+++ b/docker/swift/swift-object-updater/config-external.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+SOURCE="/opt/kolla/swift/swift.conf"
+TARGET="/etc/swift/swift.conf"
+SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf"
+TARGET_OBJECT_SERVER="/etc/swift/object-server.conf"
+OWNER="swift"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0640 $TARGET
+fi
+
+if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then
+ cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER
+ chown ${OWNER}: $TARGET_OBJECT_SERVER
+ chmod 0640 $TARGET_OBJECT_SERVER
+fi
diff --git a/docker/swift/swift-object-updater/start.sh b/docker/swift/swift-object-updater/start.sh
new file mode 100755
index 000000000..744344f74
--- /dev/null
+++ b/docker/swift/swift-object-updater/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-object-updater"
+ARGS="/etc/swift/object-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/swift/swift-proxy-server/Dockerfile.j2 b/docker/swift/swift-proxy-server/Dockerfile.j2
new file mode 100644
index 000000000..54d024f8b
--- /dev/null
+++ b/docker/swift/swift-proxy-server/Dockerfile.j2
@@ -0,0 +1,16 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net.kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
+
+RUN yum -y install openstack-swift-proxy && yum clean all
+
+ {% endif %}
+{% endif %}
+
+COPY ./start.sh /start.sh
+COPY config-external.sh /opt/kolla/
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/swift/swift-proxy-server/config-external.sh b/docker/swift/swift-proxy-server/config-external.sh
new file mode 100755
index 000000000..434cce7e5
--- /dev/null
+++ b/docker/swift/swift-proxy-server/config-external.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+OWNER="swift"
+
+if [[ -f "/opt/kolla/swift/swift.conf" ]]; then
+ cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf
+ chown ${OWNER}: /etc/swift/swift.conf
+ chmod 0640 /etc/swift/swift.conf
+fi
+
+if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then
+ cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz
+ chown ${OWNER}: /etc/swift/object.ring.gz
+ chmod 0640 /etc/swift/object.ring.gz
+fi
+
+if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then
+ cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz
+ chown ${OWNER}: /etc/swift/container.ring.gz
+ chmod 0640 /etc/swift/container.ring.gz
+fi
+
+if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then
+ cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz
+ chown ${OWNER}: /etc/swift/account.ring.gz
+ chmod 0640 /etc/swift/account.ring.gz
+fi
+
+if [[ -f "/opt/kolla/swift-proxy-server/proxy-server.conf" ]]; then
+ cp /opt/kolla/swift-proxy-server/proxy-server.conf /etc/swift/proxy-server.conf
+ chown ${OWNER}: /etc/swift/proxy-server.conf
+ chmod 0640 /etc/swift/proxy-server.conf
+fi
diff --git a/docker/swift/swift-proxy-server/start.sh b/docker/swift/swift-proxy-server/start.sh
new file mode 100755
index 000000000..99a142e52
--- /dev/null
+++ b/docker/swift/swift-proxy-server/start.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/swift-proxy-server"
+ARGS="/etc/swift/proxy-server.conf --verbose"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+source /opt/kolla/config-swift.sh
+
+# Execute config strategy
+set_configs
+
+exec $CMD $ARGS
diff --git a/docker/zaqar/Dockerfile.j2 b/docker/zaqar/Dockerfile.j2
new file mode 100644
index 000000000..4e3a0bc52
--- /dev/null
+++ b/docker/zaqar/Dockerfile.j2
@@ -0,0 +1,32 @@
+FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
+
+RUN yum -y install openstack-zaqar && yum clean all
+
+ {% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+ {% endif %}
+{% elif install_type == 'source' %}
+
+ADD zaqar.tar /
+RUN ln -s /zaqar-* zaqar \
+ && useradd --user-group zaqar \
+ && pip --no-cache-dir install /zaqar \
+ && mkdir -p /etc/zaqar /var/log/zaqar /home/zaqar \
+ && cp -r /zaqar/etc/* /etc/zaqar/ \
+ && chown -R zaqar: /etc/zaqar /var/log/zaqar /home/zaqar
+
+{% endif %}
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/zaqar/config-external.sh b/docker/zaqar/config-external.sh
new file mode 100644
index 000000000..7ed6da2eb
--- /dev/null
+++ b/docker/zaqar/config-external.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+SOURCE="/opt/kolla/zaqar/zaqar.conf"
+TARGET="/etc/zaqar/zaqar.conf"
+OWNER="zaqar"
+
+if [[ -f "$SOURCE" ]]; then
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/zaqar/start.sh b/docker/zaqar/start.sh
new file mode 100755
index 000000000..fa1050280
--- /dev/null
+++ b/docker/zaqar/start.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/bin/zaqar-server"
+ARGS=""
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ su -s /bin/sh -c "zaqar-manage db_sync" cinder
+ exit 0
+fi
+
+exec $CMD $ARGS