It is messy because VM layer is unnecessary. If OSX had native support for containers or if ur dev laptop was linux then all you had to do was use docker directly with dockerfile. That is the purpose of docker. To make usage of container virtualization easy and standardized and to be used directly on baremetal. All the convolutions introduced by the VM virtualization will evaporate as container support becomes standard across all OS.
I am not vagrant user... but what role can it play when my dev laptop is ubuntu for eg? Does it become redundant layer if all my virtualization,configuration and deployment needs are met by docker and dockerfile?
It depends on your perspective. Vagrant is billed as a manager of development environments. It has a well known and easy to use workflow for creating/modifying/destroying those environments (vagrant up/provision/destroy). With its Docker integration, it provides you with a nice management layer for managing those Docker development environments. You could achieve the same thing with Docker directly, but there would be some non-zero amount of work required to create your workflow commands and share that development environment with others (whereas with Vagrant you just need to share a Vagrantfile).
Here's an interesting Stack Overflow question related to this topic, http://stackoverflow.com/questions/16647069/should-i-use-vag.... Also, it looks like Docker is working to build out its own development environment tools using Fig, but that seems a bit nascent right now.
"All we’re doing is installing the latest stable version of Docker, direct from Docker’s own apt repository, configuring it to listen for both TCP and socket connections, updating the rest of the system, and installing avahi for multicast DNS resolution."
Installing avahi for multicast DNS resolution? Why does he need avahi? Why does he need multicast DNS resolution?
[Update: I don't know why the person that replied deleted their comment, because it was useful info. Here it is, for posterity:
1) Add's the docker key from the Ubuntu keyserver, which is already trusted, so the docker packages can be installed.
2) Avahi lets him name his docker containers and then discover them on the local mac os host and the linux VM, eg wossname.nginx, rather than some dynamically assigned IP.]
Interesting... Didn't think that avahi would work across subnets. I hope it works with the OSX firewall turned on and set to secure settings. Will need to test, but there are workarounds I've had to use in similar situations.
As mentioned in the article, Vagrant actually comes with built-in support [1] to run Docker containers. Ideally it would obviate the need to do some of the manual work done here to get this type of environment up and running.
The Vagrant support for Docker uses boot2docker, which only supports VirtualBox, so I’m left high and dry.
You can use a proxy Vagrantfile to configure the type of machine that is used as the Docker host [2]. Unfortunately there is a bug [3] that make this not quite usable yet.
11 comments
[ 2.7 ms ] story [ 41.3 ms ] threadHere's an interesting Stack Overflow question related to this topic, http://stackoverflow.com/questions/16647069/should-i-use-vag.... Also, it looks like Docker is working to build out its own development environment tools using Fig, but that seems a bit nascent right now.
"The trouble is that I’m obstinate: I’ve paid for a VMWare Fusion license, and I’m insisting on using it."
VirtualBox is free, and all the work to make Docker run easily has already been done. But the author only wants to use VMWare, so it got complicated.
Installing avahi for multicast DNS resolution? Why does he need avahi? Why does he need multicast DNS resolution?
[Update: I don't know why the person that replied deleted their comment, because it was useful info. Here it is, for posterity:
1) Add's the docker key from the Ubuntu keyserver, which is already trusted, so the docker packages can be installed.
2) Avahi lets him name his docker containers and then discover them on the local mac os host and the linux VM, eg wossname.nginx, rather than some dynamically assigned IP.]
1. https://docs.vagrantup.com/v2/docker/index.html
2. https://github.com/maspwr/vagrant-docker-dev
3. https://github.com/mitchellh/vagrant/issues/4856