Use a single VM with Vagrant to host Docker Containers across multiple projects -
i have 2 separate projects/src/code repos, using vagrant run application in docker containers.
i using vagrant centos7 host vm host docker containers (https://www.vagrantup.com/docs/docker/basics.html). using duplicate copy of centos7 vm vagrantfile (vagranfile.host
) in each project.
- proj1/ -- vagrantfile -- vagrantfile.host - proj2/ -- vagrantfile -- vagrantfile.host
each vagrantfile
points vagrantfile.host
spin centos vm host docker containers.
the difference (effectively question) between 2 projects vagrantfile
in proj1
points different docker image 1 in proj2
.
when vagrant up
in each project folder, each 1 create's it's own centos7 vm instantiation, end running 2 separate virtualbox vms.
is there way change 1 or both of vagrantfile
files end spinning single vm, , containers both run in same virtualbox vm?
got work. not quite way wanted, documenting finds question later. point both docker vagrantfile's same vagrantfile.host linux parent.
- proj1/ -- vagrantfile --> ./vagrantfile.host -- vagrantfile.host - proj2/ -- vagrantfile --> ../proj1/vagrantfile.host
Comments
Post a Comment