Hello

you need to glue 2 things.

glue1,

you can force to always use a proxy linux box, in that case your linux box
will be the same as win or mac

by default, a new vm will be fired up, and a docker container will run
inside.
the simple approach is just 1 vagrantfile for the docker, here you do
vagrant up and vagrant does the magic

now, you can get a bit more in control of this, a have 2 vagrantfiles, one
for the base host where docker will run, and one for the docker it self

in the documentation, have a look around here:

https://docs.vagrantup.com/v2/docker/basics.html

Read about the host VM

basically you define a vagrantfile that will be used for this host:

  config.vm.provider "docker" do |d|
    d.vagrant_vagrantfile = "../path/to/Vagrantfile"
  end

Here, let me say it again, with this you get more control on your base box,
so you would be able to specify the base box, provider, and scripts to
provision.

glue2.

In the docker file you can expose ports, so you can run a web server expose
80 on the docker to 80 on the host (vm)

then on the vagrantfile of that box, you can expost that 80 to the real
host as say 8080

Docker 80 -> vm 80 -> real pc 8080

make any sense?

The docker way to do it is you expose ports to the base host.


On Fri, Oct 3, 2014 at 5:29 PM, Jamie Jackson <[email protected]> wrote:

> Hi Folks,
>
> I'm pretty new to Vagrant, but I managed to create a VirtualBox VM with an
> app stack and an auto-populated Maria DB, which I'll be able to share with
> other developers on the team just by giving them a directory with a
> Vagrantfile and included shell provisioner scripts.
>
> Just today, I started playing with switching the provider over to Docker.
> That's had some snags along the way, but I think most of it is worked out.
> However, one thing I'm used to with the VirtualBox provider is being able
> to specify a static IP for the VM for host-only communication:
>
>
> config.vm.network :private_network, ip: "192.168.56.10"
>
>
> Then, I can simply have a permanent host entry of:
>
> 192.168.56.10 local.mysite.com
>
>
> I haven't figured out how to do the same with the Docker provider. [It
> assigns the IP dynamically, and it seems to change for some (maybe all)
> vagrant ups.]
>
> How do I accomplish this sort of thing with the Docker provider? For what
> it's worth, I'm developing the Vagrant project on Linux, but it will be
> also used by teammates on Macs and Windows.
>
> Thanks,
> Jamie
>
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to