ericmann / vvv-apache

Apache-based fork of 10up's Varying Vagrant Vagrants configuration
56 stars 22 forks source link

Docker #1

Closed mastef closed 10 years ago

mastef commented 10 years ago

Have you considered moving this to docker?

http://stackoverflow.com/questions/16647069/should-i-use-vagrant-or-docker-io-for-creating-an-isolated-envinronment

http://docs.docker.io/en/latest/installation/vagrant/

https://github.com/jbfink/docker-wordpress

ericmann commented 10 years ago

No, specifically because of the differences between Docker and Vagrant. From the very first SO post you linked:

Docker on the other hand uses kernel cgroup and namespacing via lxc. It means that you are using the same kernel as the host and the same file system.

If you're working on Linux and developing against a Linux server, that's fine. If you're working across Windows, Linux, and Mac OS (which I and many on my team are doing) then it's not the best solution.

mastef commented 10 years ago

Thanks for replying, but yeah, that's not a blocker though.

Windows and Mac users still would use Vagrant to boot into a Unix environment - and that's what Vagrant / Virtual Boxes are good for.

But for the working environment/sub-modules Docker is more convenient and much more efficient as you save resources, boot up times ( a new instance up within a second ) and hard drive space ( no need for virtual drives ). Also Docker comes with a private image repository, in which you only have to re-build a container once, only the changes are uploaded ( minimal size, not whole images ) and the whole team can use it, instead of reinstalling images after a rule has been adjusted.

Take for example https://github.com/Krijger/docker-cookbooks

His base image is the supervisor one, which creates a basic container ( Ubuntu with apt-get upgrade, etc. Pretty simple : https://github.com/Krijger/docker-cookbooks/blob/master/supervisor/Dockerfile ). Once that is built he uses this container to build all the children without re-creating the first steps ( all previous steps are in cache and don't have to be re-executed )

For example to boot up an instance with Java, it simply inherits from the supervisor instance and adds the apt packages and sets ENV vars : https://github.com/Krijger/docker-cookbooks/blob/master/jdk7-oracle/Dockerfile

And from there you build the instances that require those packages, like Jenkins : https://github.com/Krijger/docker-cookbooks/blob/master/jenkins/Dockerfile

So you have a more inherited model, version controlled from the get-go ( in your private repo ) and don't have to spend time rebuilding and booting whole images, since after an image is built, 'run' takes only the time of the last CMD - everything else is cached.

In our private repos we build one image with Debian, another with Apache, and finally the separate app images. No matter if client machines are on Ubuntu or Red Hat ( or Mac/Windows ). Finally you can work locally in your production environment. Your server structure is much easier to handle and so much more efficient.

ericmann commented 10 years ago

You're welcome to use whatever tool you want. We built VVV specifically so our team would have consistent environments (including the task of booting into a VM) across different machines. This fork was built to enable devs to test against a LAMP stack whereas the original VVV provides a LEMP stack.

It you want to build a distributed environment config that uses Docker, feel free. But that's entirely outside of the scope of this project.

mastef commented 10 years ago

Hi @ericmann, I haven't realized this was a fork and instead got the stone rolling in the main repo. Cheers!