This bash script first pulls mysql:latest
docker image if you don't have. Once you have the mysql docker image, it runs two different containers simultaneously where one of them is a MySQL server and the other is an interactive MySQL client which connects back to the server. After you exit
MySQL, the client container will be killed and removed as well as the server container. Therefore do not try to develop projects on both containers because they won't exist after you exit!
If you are working on database behaviours or learning MySQL and want containers and processes to be cleaned up automatically after the work, this one-liner script is definitely for you!
$ git clone https://github.com/f4T1H21/mysql-docker-oneliner
$ cd mysql-docker-oneliner
$ chmod +x mysql-oneliner.sh
$ ./mysql-oneliner.sh
─ Written by Şefik Efe ─