- Pull mysql docker image and run it
docker run --name wordpressdb -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress -d mysql
2. Pull wordpress docker image
docker pull wordpress
3. Run the workdpress container and connect it to the mysql running container
docker run -e WORDPRESS_DB_PASSWORD=password -d --name wordpress --link wordpressdb:mysql wordpress
Now check the container's address
docker inspect wordpress | grep -i "IPAddress\":"
Done