summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-17 21:07:38 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-17 21:07:38 +0100
commit14d10bc21087e3734d4e7ac15883c76d0cd19818 (patch)
tree02600a93e7849e9f9e4ab9399c1258ec36cc2273 /Makefile
downloadmysql-galera-14d10bc21087e3734d4e7ac15883c76d0cd19818.tar.gz
mysql-galera-14d10bc21087e3734d4e7ac15883c76d0cd19818.tar.bz2
mysql-galera-14d10bc21087e3734d4e7ac15883c76d0cd19818.tar.xz
mysql-galera-14d10bc21087e3734d4e7ac15883c76d0cd19818.zip
MySQL 5.7 with Galera (produced as combination of standard MySQL container and openshift-mariadb-galera by adfinis-sygroup)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..336ccd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+all: build
+install: push
+
+.PHONY: rebuild build push start stop restart bash
+
+build: Dockerfile
+ docker build --tag chsa/mysql-galera:5.7 .
+
+rebuild: Dockerfile
+ docker build --no-cache --tag chsa/mysql-galera:5.7 .
+
+push: build
+ docker push chsa/mysql-galera:5.7
+
+start: build
+ if [ `docker ps | grep chsa/mysql-galera | wc -l` -eq 0 ]; then \
+ if [ `docker ps -a | grep mysql-galera | wc -l` -gt 0 ]; then \
+ echo "Removing the stalled copy..." ;\
+ docker stop mysql-galera ;\
+ docker rm mysql-galera ;\
+ fi ;\
+ docker run --name mysql-galera -t -d chsa/mysql-galera:5.7 ;\
+ else \
+ echo "Already running..." ;\
+ fi
+
+stop:
+ @if [ `docker ps | grep mysql-galera | wc -l` -gt 0 ]; then \
+ docker stop mysql-galera ;\
+ docker rm mysql-galera ;\
+ fi
+
+restart:
+ make stop
+ make start
+
+bash: build
+ docker exec -it mysql-galera /bin/bash