Okay. So, yeah, speaking as someone who’s been working with Docker in three years, yeah, I’ve seen a lot of improvements, and especially putting myself in beginner’s shoes. I can’t imagine anymore how I felt about Docker.
So I’ve seen the tool, let’s call it, grow over the years. And… I understand what you’re saying.
And especially probably since it’s grown so quickly and so many bells and whistles have been added on top of that, it indeed might look a bit daunting to get started with. But the good thing is that… I must say that the documentation they provide is really complete.
It takes you by the hand and it will guide you along the way of setting up your first container and then building up from there. One of the nice improvements that have been done over the last year, maybe a bit longer, is that Docker also kept adding new tools into their ecosystem. For instance, one of the tools is Docker Machine. which is kind of a provisioning, kind of light configuration management tool that will make it really easy to have a host.
It can be a server, it can be your laptop, it can be a VM, it doesn’t matter. but a host to make sure that that host can run Docker, so that Docker is installed without even having to know too much about that host. What Linux distribution doesn’t care, the tool will figure that out for itself. Again, my local machine or something that’s installed in the US or in Australia, it doesn’t matter.
Docker machine… You just run one command against that host or a group of hosts even. You can say, okay, here are a thousand servers in my AWS account.
Make sure they all run Docker. So that’s one tool. Docker Machine allows you to do that very simply.
Then another one, and then… So Docker Machine was, let’s say, more on the ops side, wearing the ops hat. When we flip over to the development side of things, so we switch our hat…
So you mentioned a WordPress application. So there will be a PHP part, an application that runs PHP code. There will be a MySQL database.
There will be an Apache in front of that. Maybe something like a log shipping container because I want my logs to be centralized somewhere. have this this stack of application maybe even a cache let’s show in a cache a memcache so let’s say we have four to five different components of this application well there’s a second tool that is natively provided with docker these days so when you install docker you get it for free and it’s called docker compose And what Docker Compose allows you to do is very simply in a YAML file is define your full application and say, OK, I have my application container. So that’s my PHP code.
It needs to run this PHP container. Okay, then underneath I define MySQL and I say, okay, MySQL, sorry, and I say within the part of my application container, okay, and link on the network to my MySQL container. So the kind of… service discovery like the the very basic light service discovery already happens within that part so you don’t have to configure too much within your containers you can just define it in the docker compose file container a connects to container b and that’s it And so on.
So your log shipping container, you can all, within that same file. So in the end, you end up with a file that defines your four, five, whatever applications. And then it’s just a matter of… writing Docker Compose up in your command line tool, and Docker Compose will then see, okay, I have to run all these applications, what are the dependencies, which one will come first, but in the end, it will run all the containers that you’ve defined, make sure they connect to each other on network, add in some volume here and there maybe, and within a couple of…
Second, you have your full application stack running on your local machine by just running one command line command.