Mixed environments – the Docker provisioner
In addition to the Docker provider, Vagrant can help manage Docker containers and mixed environments using the Docker provisioner. The Docker provisioner can be used to build a virtual machine that hosts Docker containers, or perhaps a host that is provisioned with software with maybe one or two services managed by Docker containers. (For example, a virtual machine can be configured with a database or middleware installation managed in Docker containers, while the machine itself is configured to run a web application natively.)
The Docker provisioner will also manage the Docker runtime, which installs Docker on the virtual machine if necessary. In this example, we'll take a look at installing a MySQL database (using the Docker provisioner) and the MySQL image published on Docker Hub.
How to do it...
- Start with a simple Vagrantfile. This Vagrantfile defines a box (in this case, an Ubuntu image) and a Docker provisioner block:
# -*- mode...