summaryrefslogtreecommitdiffstats
path: root/mysql/Makefile
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-21 22:00:26 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-21 22:00:26 +0100
commit823f5325df405286024cdf2a985732baabc0981f (patch)
tree3274e3e970c6ddbbedc97cdaeb55a060a7f6d310 /mysql/Makefile
parent9d9925ec86bb779c60655bbf487d7921f22a36eb (diff)
downloadmysql-galera-823f5325df405286024cdf2a985732baabc0981f.tar.gz
mysql-galera-823f5325df405286024cdf2a985732baabc0981f.tar.bz2
mysql-galera-823f5325df405286024cdf2a985732baabc0981f.tar.xz
mysql-galera-823f5325df405286024cdf2a985732baabc0981f.zip
Add Dockerfile for simple Master/Slave replication and add more parametrization
Diffstat (limited to 'mysql/Makefile')
-rw-r--r--mysql/Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/mysql/Makefile b/mysql/Makefile
new file mode 100644
index 0000000..fcf088d
--- /dev/null
+++ b/mysql/Makefile
@@ -0,0 +1,47 @@
+all: build
+install: push
+
+.PHONY: rebuild build push start stop restart bash peer-finder
+
+
+build: Dockerfile
+ docker build --tag chsa/mysql:5.7 .
+
+rebuild: Dockerfile
+ docker build --no-cache --tag chsa/mysql:5.7 .
+
+push: build
+ docker push chsa/mysql:5.7
+
+login:
+ docker login -u `oc whoami` -p `oc whoami -t` docker-registry-default.kaas.kit.edu
+
+kaas: build login
+ docker tag chsa/mysql:5.7 docker-registry-default.kaas.kit.edu/adei/mysql:5.7
+ docker push docker-registry-default.kaas.kit.edu/adei/mysql:5.7
+
+
+start: build
+ if [ `docker ps | grep chsa/mysql | wc -l` -eq 0 ]; then \
+ if [ `docker ps -a | grep mysql | wc -l` -gt 0 ]; then \
+ echo "Removing the stalled copy..." ;\
+ docker stop mysql ;\
+ docker rm mysql ;\
+ fi ;\
+ docker run --name mysql -t -d chsa/mysql:5.7 ;\
+ else \
+ echo "Already running..." ;\
+ fi
+
+stop:
+ @if [ `docker ps | grep mysql | wc -l` -gt 0 ]; then \
+ docker stop mysql ;\
+ docker rm mysql ;\
+ fi
+
+restart:
+ make stop
+ make start
+
+bash: build
+ docker exec -it mysql /bin/bash