Docker ubuntu container vs Docker in Vagrant ubuntu VM

Hi Docker gurus,

I’m researching on the follow two configurations on my Mac and would like to hear your comments please.

A) Running a ubuntu Vagrant VM instance on MacOS and then multiple docker containers inside the VM
B) Running multiple docker ubuntu containers directly on top of Mac OS

What I need is a dev/qa environment that is closely matching my production environment: several ubuntu 14 boxes running a few python web services and mysql databases.

I like option A because it gave me a totally isolated ubuntu dev environment in Mac. The VM can also be easily tinkered to be as close to the production system as possible in terms of the OS and python version. To simulate the multiple web service end points and mysql instances, I plan to deploy them in their separated docker containers inside the ubuntu VM. This way, I don’t need to launch multiple vagrant boxes that could exhaust my resources on my Mac.

The alternative option B, however, is supposed to be light-weight because the latest docker VM running on top of Mac OS contains only bare-bone ubuntu OS. I also don’t need to carve out a big chunk of my Mac OS memory/cpu dedicated to the Vagrant box beforehand.

The interesting question for me is that in option B, after installing all the system softwares to run the multiple python and mysql services in multiple docker containers, how heavy will the system become so that there is no big difference between the two options.

I’ll probably do some benchmark in near future, but I’d like to also hear from you guys whether any of people here have any experience on this regard.

There are different things to consider here:

  • Do you plan to put each of the web services and mysql database as separate containers or put them all in same container? Typically, its advisable to keep 1 service per container. If you put them in separate containers, you would need to create the environment using Docker compose.

  • What do you plan to use the development environment for? Is it something like users will write apps using the developer environment? Do you need developer tools as well? If the user is going to write apps, they can extend the base container to write apps.

  • Even if you have a VM, each container running on top of VM will have its own set of Python versions as there wont be any sharing with the VM.

I would go with option 1 if there is a set of developer tools that is needed between all developers which is not planned to be put in containers. Otherwise, i will go with option 2.