Shortly after discovering that mysql released a new push to the latest tag I proceeded to pull down the updates and deploy an application that was using the mysql:latest image.
I soon realized that I was no longer able to make a connection to the container from one of the docker-compose services that previously made connections to the container.
After investigating and searching for an issue on Github I soon discovered that others were experiencing this problem as well.
I was able to recover my data and deploy the docker-compose stack by following these steps.
Note this works if you've mounted the volume of your mysql data
- docker exec into the container while it's running on mysql 8
- mysqldump the database to a file within the mounted directory
- exit the container and navigate to the directory where you've mounted on the host machine
- copy the file from mounted directory out of the mounted directory
- blitz / rm the mounted directory
- update docker-compose to use mysql:5.7
- docker-compose up and force recreate the container (it will recreate the mounted directory)
- after the mounted directory is created **copy** don't move but copy the .sql file back into the mounted directory
- docker exec into the mysql container and mysql restore the .sql file to the corresponding database
- exit the contaier
- never use mysql:latest tag again
mysqldump -u [uname] -p[pass] db_name > db_backup.sql
mysql -u username -p database_name < file.sql