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