Report this

What is the reason for this report?

MySQL and Wordpress Dockers do not keep running

Posted on November 15, 2014

Dear all, I want to get Wordpress running using Docker on CoreOS. I followed all the instructions for MySQL, I gave the following command:

docker run --name wordpress-mysql -e MYSQL_ROOT_PASSWORD=rtpassword -e MYSQL_USER=fvhemert -e MYSQL_PASSWORD=usrpassword -e MYSQL_DATABASE=wordpress -d mysql

Stangely, the container run for a short while, typing “docker ps” I see it but after some second I “docker ps” again and it is gone, I still see it using “docker ps -a”.

Subsequently I give the command:

docker run --name fvhemert-wordpress --link=wordpress-mysql:mysql -e WORDPRESS_DB_USER=fvhemert -e WORDPRESS_DB_PASSWORD=usrpassword -e WORDPRESS_DB_NAME=wordpress -p 8080:80 -d wordpress

There a no further errors but “docker ps” does not show any running containers, they both are present when typing “docker ps -a” and have that status “excited”. Why?

I don’t want them exited, I though that the “-d” argument would make them runs as daemons and keep them active? There is not active page on the ip.adres:8080 or ip.adres:80.

Any suggestions? What am I doing wrong?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If you have $5 512M Droplet, just enable swap. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-12-04 I stuck with this for a few days until I found this solution.

I’m having the same problems. How did you guys solve this?

@fvhemert

Your original mysql docker command is as follows:

docker run --name wordpress-mysql -e MYSQL_ROOT_PASSWORD=rtpassword -e MYSQL_USER=fvhemert -e MYSQL_PASSWORD=usrpassword -e MYSQL_DATABASE=wordpress -d mysql

“Looking” at this i think you are missing the -p command that specifies a port for mysql operations aka tcp:3306.

There are two ways you can sort this out.

  1. use --expose 3306 when running mysql container.

  2. use -p :3306:3306 when running mysql container. (just make sure you don’t allow wan access on 3306).

Hopefully, this should solve your problem.

Best Regards Hareem Haque

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.