$ git clone https://github.com/jay-johnson/docker-schema-prototyping-with-mysql.git
$ ./start_composition.sh
Starting with Docker Compose
Pulling db (jayjohnson/schemaprototyping:latest)...
latest: Pulling from jayjohnson/schemaprototyping
a3ed95caeb02: Pull complete
5989106db7fb: Pull complete
75e2f0ff048c: Pull complete
98d3fe0e5a2b: Pull complete
cb2b06526018: Pull complete
d3f18fb8fd93: Pull complete
dbbbb36603a9: Pull complete
fea73f54e760: Pull complete
590f6232d0c3: Pull complete
7a4d25f8a269: Pull complete
c8dd899cb1db: Pull complete
b2540ace42c3: Pull complete
b5b1828daba4: Pull complete
Digest: sha256:a4df1305df7bb306c3338b365ad945cee1f87d282d6672b331d69f8832856b63
Status: Downloaded newer image for jayjohnson/schemaprototyping:latest
Creating schemaprototyping
This script uses the MySQL console to verify connectivity to the container's MySQL database once it is ready. Here is how to run it:
$ ./verify_mysql_user.sh
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> quit
Bye
$ docker exec -ti schemaprototyping cat /tmp/startcontainer.log
Preparing MySQL from Dir(/opt/db-loaders)
Waiting on Prepare
Done Preparing MySQL
Flashing and Initializing MySQL
$ ./stop_composition.sh
Stopping with Docker Compose
Stopping schemaprototyping ... done
$ sed -i 's/REBUILD_DB_ON_START=1/REBUILD_DB_ON_START=0/g' docker-compose.yml
$ ./start_composition.sh
Starting with Docker Compose
Recreating schemaprototyping
$ ./verify_mysql_user.sh
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> quit
Bye
$ docker exec -ti schemaprototyping cat /tmp/startcontainer.log
Using existing Database in Dir: /var/lib/mysql
Removing first time flag
Tailing the logs for keeping the container open