-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (26 loc) · 998 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
V=8.0
DB_DIR=$(shell pwd)/_db-$(V)
mV=10.3
mDB_DIR=$(shell pwd)/_db-$(mV)
start_db:
@echo Starting MySQL $(V)
docker run --rm -d --name spatial-mysql \
-p 3306:3306 \
-v $(DB_DIR):/var/lib/mysql \
-e MYSQL_DATABASE=spatial_test \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
mysql:$(V) --character-set-server=utf8 --collation-server=utf8_general_ci --default-authentication-plugin=mysql_native_password
start_db_maria:
@echo Starting MariaDB $(mV)
docker run --rm -d --name spatial-mysql \
-p 3306:3306 \
-v $(DB_DIR):/var/lib/mysql \
-e MYSQL_DATABASE=spatial_test \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
mariadb:$(mV) --character-set-server=utf8 --collation-server=utf8_general_ci --default-authentication-plugin=mysql_native_password
rm_db:
docker stop spatial-mysql || true
rm -Rf $(DB_DIR)
refresh_db: rm_db start_db
get_ip:
@docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' spatial-mysql