Docker Tips and Tricks Cheatsheet

Advanced Docker commands
Tags : docker

Backup and restore a mysql database
Backup
$ docker exec CONTAINER /usr/bin/mysqldump -u root DATABASE > backup.sql

Restore
$ cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root DATABASE