How Vagrant, ansible, and docker can make Linux dev machine as close to production as possible

Sorry for the implicit title here that I would like to achieve

  • get my docker web application (one container for the database, one for the cache, one for php-fpm + code)
  • in production, since I don't have tramps, I would like the standard available with the docker module to provide an environment
  • since my developers have Linux machines and docker firewall support as a provider, I would like these docker containers to run directly in our dev machines without a VM (since we have many projects, the support of one VM per project soon ran out of RAM, and we need to often stop / turn off the machines, especially during the maintenance phase).
  • We have some Mac / Windows developers, so we still need to wander around to provide a stray level of abstraction in order to have a simple dev environment for the brain.

I know how to use Vagrant + Ansible to create one machine and I know how to use access with the docker module to create a complete environment, following the example in

http://docs.ansible.com/docker_module.html

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.provision :ansible do |ansible|
      ansible.playbook = 'provisioning/site.yml'
      ansible.extra_vars = app_vars
      ansible.verbose = verbosity_arg
  end
end

but then it will run inside the virtual machine

I know how to use Vagrant to create multiple machines in one stray file

Vagrant.configure(2) do |config|
  config.vm.define :dbmachine do |dbmachine|
    dbmachine.vm.provider = "docker" do |d|
       ...
    end
  end
  config.vm.define :cachemachine do |cachemachine|
    cachemachine.vm.provider = "docker" do |d|
       ...
    end
  end
end

But then in the production / production, since I do not have tramps, I no longer have things that describe architecture

So, is there a way to combine these things to meet my needs?

+4
1

:

  • . , , . , " ". / .., , . : dockerize db, ,
  • - . - . Vagrant ( VMWare/ ..), ( ), . , .
  • Mac/Windows Docker Mac Docker Windows, . . , . ( , Linux ansible docker, Mac Windows, .)
  • Dockerfile, vagrantfile / . unsible , , , . AFAIK - - . " " Docker. playbook AFTER " ". - .
  • , dev (qa/prod). Ansible SSH . , - . devboxes , / .
+5

All Articles