-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
40 lines (29 loc) · 966 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
33
34
35
36
37
38
39
SHELL=/bin/bash
SERVICE=NRPD
VERSION=1.0.0
MYSQL_ROOT_PASSWORD= s3cr3t
build:
docker build -f Dockerfile -t ai-proficient-mysql:${SERVICE}-${VERSION} .
run:
docker run --rm --name aip-mysql-${SERVICE} -v $(CURDIR):/data \
-p 3302:3302 \
-e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} \
ai-proficient-mysql:${SERVICE}-${VERSION}
exec:
docker exec -it \
-e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} \
aip-mysql-${SERVICE} bash
insert:
docker exec \
-e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} \
aip-mysql-${SERVICE} bash -c \
"mysql -u root --password=${MYSQL_ROOT_PASSWORD} -D results_db < /data/insert.sql "
test:
docker exec \
-e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} \
aip-mysql-${SERVICE} bash -c \
"mysql -u root --password=${MYSQL_ROOT_PASSWORD} -D results_db < /data/test.sql "
stop:
docker stop aip-mysql-${SERVICE}
clean:
docker rmi ai-proficient-mysql:${SERVICE}-${VERSION}