From 2fd3a5bafd83c1add4e494b657b1b58e8b663b7e Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Wed, 12 Aug 2015 06:32:36 +0000 Subject: [PATCH] Add Dockerfile template for mariadb Change-Id: I4a1e97f683323176aa8e77ac18be16576941dbdb Partially-Implements: blueprint dockerfile-template --- docker_templates/galera/Dockerfile.j2 | 36 ++++++++++++++++++++++ docker_templates/galera/config-external.sh | 1 + docker_templates/galera/config-galera.sh | 1 + docker_templates/galera/start.sh | 1 + 4 files changed, 39 insertions(+) create mode 100644 docker_templates/galera/Dockerfile.j2 create mode 120000 docker_templates/galera/config-external.sh create mode 120000 docker_templates/galera/config-galera.sh create mode 120000 docker_templates/galera/start.sh diff --git a/docker_templates/galera/Dockerfile.j2 b/docker_templates/galera/Dockerfile.j2 new file mode 100644 index 0000000000..3b8611ae78 --- /dev/null +++ b/docker_templates/galera/Dockerfile.j2 @@ -0,0 +1,36 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_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 + +{% elif base_distro in ['ubuntu', 'debian'] %} + +RUN ["/bin/false"] + +{% endif %} + +COPY config-galera.sh /opt/kolla/config/ +COPY config-external.sh /opt/kolla/ +COPY start.sh / + +CMD ["/start.sh"] diff --git a/docker_templates/galera/config-external.sh b/docker_templates/galera/config-external.sh new file mode 120000 index 0000000000..7fb399006f --- /dev/null +++ b/docker_templates/galera/config-external.sh @@ -0,0 +1 @@ +../../docker/common/galera/config-external.sh \ No newline at end of file diff --git a/docker_templates/galera/config-galera.sh b/docker_templates/galera/config-galera.sh new file mode 120000 index 0000000000..7227efbaf1 --- /dev/null +++ b/docker_templates/galera/config-galera.sh @@ -0,0 +1 @@ +../../docker/common/galera/config-galera.sh \ No newline at end of file diff --git a/docker_templates/galera/start.sh b/docker_templates/galera/start.sh new file mode 120000 index 0000000000..0c6dbd38fb --- /dev/null +++ b/docker_templates/galera/start.sh @@ -0,0 +1 @@ +../../docker/common/galera/start.sh \ No newline at end of file