That was all super easy-ish, let's now take a look at a compelling feature of Docker that allows you to start multiple containers at once with your stack definition stored in a handy YAML file.
If you have either Docker for Mac or Docker for Windows installed then it already comes bundled with docker-compose
, if however, you are using Linux, then you may need to install this yourself as it does not come as part of the default Docker package.
To install Docker Compose on Linux, execute the following command in your terminal:
$ curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
Before we look at how we can run our application with docker-compose
, let's take a look at the file we are going to run and some of the important facets of it:
1 version: '2' ...