kolla/docker_templates/galera/Dockerfile.j2
Steven Dake bd5e5bbb64 Use one data container for all data volumes
The previous method of using the API image for a data container
worked, but resulted in more data being bindmounted and copied
into the system.  This patch resolves that by essentially using
a distro-type as a FROM in a Dockerfile to generate
distro-type-data.  Further all of the data containers used
throughout ansible are modified to use this new data container.

Change-Id: I8846573d4f2d4b98d4f46c770bfefc6d4c5cd0b5
Partially-Implements: blueprint one-data-container
2015-08-18 20:52:27 -07:00

41 lines
1.3 KiB
Django/Jinja

FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %}
RUN echo "[mariadb]" > /etc/yum.repos.d/MariaDB.repo && \
echo "name = MariaDB" >> /etc/yum.repos.d/MariaDB.repo && \
echo "baseurl = http://yum.mariadb.org/10.0/centos7-amd64" >> /etc/yum.repos.d/MariaDB.repo && \
echo "gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB" >> /etc/yum.repos.d/MariaDB.repo && \
echo "gpgcheck=1" >> /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 \
&& 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'] %}
RUN ["/bin/false"]
# TODO(sdake) when ubuntu support is implemented we will need a line
# && rm -rf /var/lib/mysql/
{% endif %}
COPY config-galera.sh /opt/kolla/config/
COPY config-external.sh /opt/kolla/
COPY start.sh /
CMD ["/start.sh"]