From the last post, it was necessary to pull the 5.7 tag instead of the latest because the latest was MySQL 8.0 had SSL enabled by default. MySQL 5.7 is more compatible with WordPress since it doesn’t have SSL enabled. It should not be accessible over the internet, so I change changed bind-address = 0.0.0.0 to bind-address = localhost in my.cnf and used a ssh tunnel with this option:
-L 3306:localhost:3306
It was necessary to get a 5.7 database too. I used the same process as from the last post to tar, zip and ftp it from the container. I want to use my own wp-content so I used:
-v /my/own/wp-content:/var/www/html/wp-content
The final command I used to launch the container was:
docker run –name some-wordpress -e WORDPRESS_DB_HOST=zenbook:3306 -e WORDPRESS_DB_PASSWORD=my-secret-pw -v /my/own/wp-content:/var/www/html/wp-content -p 8081:80 -d wordpress