In this article I’ll show you how to set up Docker in a much easier way. Docker has an official image for WordPress that makes it easier to get started. We’ll also check out Docker Compose for a Heroku-like configuration. After all, building and managing containers manually can take a lot of work.
The Official WordPress Docker Image
Before we get started, make sure you create a new folder and navigate inside that folder.
If you are on OSX running through boot2docker you need to add port forwarding -p 80:80 I am not sure if it matters where: $ docker run -e WORDPRESS_DB_PASSWORD=password -d -p 80:80 --name wordpress --link wordpress-db:mysql wordpress
Then you need to let VirtualBox know: $ VBoxManage modifyvm "boot2docker-vm" --natpf1 "guestnginx,tcp,,80,,80"
$ boot2docker ip gives you the address of your machine for me I goto http://192.168.59.103 in my browser.
I got stuck on this for quite awhile. The section “Use the host-only interface (preferred)” at vbox-portforward by jonseymour cleared it up for me.
Did you also get the following error after running docker-compose up?
web_1 | Complete! WordPress has been successfully copied to /var/www/html
mysql_1 | 2015-07-31T07:35:10.646809Z 2 [Warning] IP address ‘172.17.0.8’ could not be resolved: Name or service not known
thank you Aleksander,
i started by following the official quickstart guide for wordpress/docker-composer but was confronted by the inability to add plugins/themes. and no clear explanation as to why. your series of guide cleared (and clarified) this hurdle.
now, i have a problem with using the wp import tool. my import XML is 2.5MB and so i hit the default PHP 2mb limit. i attached to the wordpress container