From 337702a9d06b4c6c08d05a7cb3a76d4974afd75d Mon Sep 17 00:00:00 2001 From: Derek Downey Date: Wed, 28 Oct 2020 09:08:37 -0400 Subject: [PATCH 1/2] Fixing error in dockerfile build. --- conf/mysql/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/mysql/Dockerfile b/conf/mysql/Dockerfile index 0fca014..798bce3 100644 --- a/conf/mysql/Dockerfile +++ b/conf/mysql/Dockerfile @@ -15,6 +15,6 @@ RUN apt-get update RUN apt-get install -y galera-4 galera-arbitrator-4 mysql-wsrep-8.0 rsync RUN chown -R mysql:mysql /var/lib/mysql -RUN mkdir /var/run/mysqld/ && chown -R mysql:mysql /var/run/mysqld +RUN mkdir -p /var/run/mysqld/ && chown -R mysql:mysql /var/run/mysqld ENTRYPOINT ["mysqld"] From 507f2435273dae4df0f3c3cb1a4b07d4375ef177 Mon Sep 17 00:00:00 2001 From: Derek Downey Date: Fri, 18 Dec 2020 17:16:32 -0500 Subject: [PATCH 2/2] Fixing galera build to only build once if necessary. --- conf/mysql/Dockerfile | 26 ++++++++++++++------------ docker-compose.yml | 3 +++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/conf/mysql/Dockerfile b/conf/mysql/Dockerfile index 590be9a..5f10c22 100644 --- a/conf/mysql/Dockerfile +++ b/conf/mysql/Dockerfile @@ -4,19 +4,21 @@ MAINTAINER Nick Vyzas ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update -RUN apt-get install -y software-properties-common -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv BC19DDBA -RUN add-apt-repository 'deb https://releases.galeracluster.com/galera-4/ubuntu bionic main' -RUN add-apt-repository 'deb https://releases.galeracluster.com/mysql-wsrep-8.0/ubuntu bionic main' +RUN apt-get update && \ + apt-get install -y software-properties-common && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv BC19DDBA && \ + add-apt-repository 'deb https://releases.galeracluster.com/galera-4/ubuntu bionic main' && \ + add-apt-repository 'deb https://releases.galeracluster.com/mysql-wsrep-8.0/ubuntu bionic main' && \ + apt-get update && \ + apt-get install -y galera-4 galera-arbitrator-4 mysql-wsrep-8.0 rsync && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -RUN apt-get update -RUN apt-get install -y galera-4 galera-arbitrator-4 mysql-wsrep-8.0 rsync - -RUN chown -R mysql:mysql /var/lib/mysql -RUN mkdir -p /var/run/mysqld/ && chown -R mysql:mysql /var/run/mysqld - -RUN apt-get clean +RUN chown -R mysql:mysql /var/lib/mysql && \ + mkdir -p /var/run/mysqld/ && \ + chown -R mysql:mysql /var/run/mysqld ENTRYPOINT ["mysqld"] diff --git a/docker-compose.yml b/docker-compose.yml index 5b0ac74..f9ccd0c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ version: "2.0" services: mysql1: + image: "proxysql/galera:latest" build: ./conf/mysql ports: - "13306:3306" @@ -11,6 +12,7 @@ services: environment: - MYSQL_ROOT_PASSWORD=root mysql2: + image: "proxysql/galera:latest" build: ./conf/mysql ports: - "13307:3306" @@ -23,6 +25,7 @@ services: environment: - MYSQL_ROOT_PASSWORD=root mysql3: + image: "proxysql/galera:latest" build: ./conf/mysql ports: - "13308:3306"