As I’ve been exploring more about Docker and containers over the past month or two, I’ve been watching MANY videos on YouTube. One of the “intro to Docker” ones that I quite liked was this one from Brad Traversy:
What I found useful was how he used the very practical example of setting up a small website using nginx. Very good use case, including the use of volumes to have content that can be re-used between containers. He also discusses how to use DockerHub to make your container image available to other systems.
However, I was struggling with getting started, because the WordPress container is just… WordPress. It also needs a database to work, and my Docker experience was not yet strong enough to sort out how to link various containers together. So I raised an issue on Github asking about a step-by-step tutorial.
Github user wglambert very kindly provided a simple docker-compose.yaml file that could launch both WordPress and MySQL in separate containers and set up the necessary network and links.
It works wonderfully! And it has now been added to the instructions on DockerHub. (Thank you to the DockerHub admins for merging it in.)
Because I want to easily use the file on different systems, I put it up in a Github repo:
As I noted in my Disruptive Conversations article, I’m planning to start writing here a good bit more about using Docker. I’m rather impressed by all that can be done – and want to capture my own experiments here for my own future knowledge… and if it helps any of you all out, too, all the better!
UPDATE – 20 Nov 2018 – I wrote this back in 2016 as I was just experimenting with Docker. Since that time, not only did Swarm emerge as Docker’s tool for container management/orchestration/clustering, but we also saw the emergence and then domination of Kubernetes as a tool for container orchestration. I’m leaving this post online, but at this point the examples are quite prominent for how Swarm and other tools can be used.