Sign inSign up

starblade/wordpress

By starblade

•Updated almost 11 years ago

My WordPress container that connects to separate MYSQL container

Image
0

255

starblade/wordpress repository overview

** Warning ** do not use yet - will be safe to use when this message is removed

Container created to connect to configured mysql container

Prereq: starblade/mysql:v2 must be running

Command: docker run --name wordpressDB -e MYSQL_ROOT_PASSWORD=password -d starblade/mysql:v2

Command: docker run --name wordpressWB --link wordpressDB:wpANDmsql -e MYSQL_PORT_3306_TCP=tcp://172.17.0.2:3306 -e WORDPRESS_DB_HOST=wordpressDB -e WORDPRESS_DB_PASSWORD=password -P -d starblade/wordpress:v2

Note: The value for "--name" that I am using "wordpressDB" can be changed to what ever you want as long as you change the value for "--link".

I am also so using wpANDmsql for the alias part of the link parameter, ie

[name of database container ---> wordpressDB:wpANDmsql <--- alias]

You will need to get the ip for the MYSQL_PORT_3306_TCP=tcp://xxx.xxx.xxx.xxx:3306

Use docker inspect command on mysql container once up and running or assign your own.

Once wordpress web is up and running set it up the way you want and commit the changes on web and mysql containers.

Please let me know if I made any mistakes or there is a better way to do this.

Hope this helps. Fly safe Commanders

Tag summary

Content type

Image

Digest

sha256:ea8966e39…

Size

141.1 MB

Last updated

almost 11 years ago

docker pull starblade/wordpress:v3