Wordpress - using external MariaDB server
9.2K
This dockerfile creates wordpress image that is based on CentOS and utilizes a centos/mariadb container for a database.
To build the wordpress container simply:
docker build -t <yourname>/wordpress:centos7 .
First get the mariadb container up and running - substitute with a path to an area that will persistent between invocations of the database container.
VOLUME='-v <persistentpath>:/var/lib/mysql:Z'
DATABASE=mydb
USER=myuser
PASSWORD=password
ROOTPASS=rootpass
docker run -d \
-e MYSQL_USER=$USER \
-e MYSQL_PASSWORD=$PASSWORD \
-e MYSQL_DATABASE=$DATABASE \
-e MYSQL_ROOT_PASSWORD=$ROOTPASS \
$VOLUME --name=mariadb centos/mariadb
NOTE:: If you don't want a VOLUME then don't assign the variable
Next start the wordpress with the db container linked:
docker run --link=mariadb:db -d --name wordpress -p 80:80 <yourname>/wordpress
Now connect to wordpress on :8080 from your browser.
Content type
Image
Digest
Size
104.5 MB
Last updated
about 9 years ago
docker pull sinenomine/wordpress-s390x