Hi Alvaro,

Port forwarding from the VM to the host would work, but I prefer to reach
my boxes directly. I forgot that I had to set up a private network to do
this, but I remembered when I came back to it this morning.

  config.vm.network "private_network", type: "dhcp" # or static IP

That gets me what I need. I'll continue to play with this example.

Thanks,
Jamie

On Wed, Mar 30, 2016 at 11:01 PM, Alvaro Miranda Aguilera <[email protected]
> wrote:

> Hello Jamie, long time.
>
> You need to do something like this:
>
> host -> vm -> docker
>
> on the container you can use
>
> d.ports = ["8080:80"]
>
> so on the VM you can use
>
> config.vm.network :forwarded_port, guest: 8080, host: 8080
>
> Then on the host you can use http://localhost:8080 and that will go to
> the container.
>
> Let me know if this helps, or is still too high level.
>
> Alvaro.
>
>
> On Thu, Mar 31, 2016 at 3:42 AM, Jamie Jackson <[email protected]>
> wrote:
>
>> First tangent: Given the example that you linked, how would I modify the
>> configurations to access nginx (on port 80) from the *vbox *host
>> (physical machine)? As that example stands, I end up with the following in
>> the *docker host* VM:
>>
>> docker0   Link encap:Ethernet
>>           inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
>>           inet6 addr: fe80::42:c7ff:fe28:1d4f/64 Scope:Link
>>
>> eth0      Link encap:Ethernet
>>           inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
>>           inet6 addr: fe80::a00:27ff:fe08:9d5f/64 Scope:Link
>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>           RX packets:161354 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:56006 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:131353816 (131.3 MB)  TX bytes:3758324 (3.7 MB)
>>
>> lo        Link encap:Local Loopback
>>           inet addr:127.0.0.1  Mask:255.0.0.0
>>           inet6 addr: ::1/128 Scope:Host
>>
>> veth01495d8 Link encap:Ethernet
>>           inet6 addr: fe80::e8a1:15ff:fecc:f646/64 Scope:Link
>>
>> And within the *docker host* VM, I can see the nginx welcome screen with
>> any of the following:
>>
>>    1. lynx 172.17.0.1
>>    2. lynx 10.0.2.15
>>    3. lynx 127.0.0.1
>>
>> However, 1 and 2 don't work from the *physical* host.
>>
>> (FWIW, I have "ubuntu/trusty64" instead of "slowe/ubuntu-trusty-x64" in
>> the host Vagrantfile, though I don't remember now why I made that switch.)
>>
>> How do I enable access to nginx? (I prefer accessing guest ports on the
>> guest IPs, rather than forwarding the ports to localhost on my physical
>> box.)
>>
>> Thanks,
>> Jamie
>>
>>
>> On Fri, Mar 25, 2016 at 7:21 PM, Vince Skahan <[email protected]>
>> wrote:
>>
>>> this help any as an example ?
>>> http://blog.scottlowe.org/2015/02/10/using-docker-with-vagrant/
>>>
>>> (google search for 'vagrant docker example' returns loads of good info)
>>>
>>>
>>> --
>>> This mailing list is governed under the HashiCorp Community Guidelines -
>>> https://www.hashicorp.com/community-guidelines.html. Behavior in
>>> violation of those guidelines may result in your removal from this mailing
>>> list.
>>>
>>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>>> IRC: #vagrant on Freenode
>>> ---
>>> 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].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/vagrant-up/b5d6e999-95da-4adf-874a-aed62b5e200c%40googlegroups.com
>>> <https://groups.google.com/d/msgid/vagrant-up/b5d6e999-95da-4adf-874a-aed62b5e200c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> This mailing list is governed under the HashiCorp Community Guidelines -
>> https://www.hashicorp.com/community-guidelines.html. Behavior in
>> violation of those guidelines may result in your removal from this mailing
>> list.
>>
>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>> IRC: #vagrant on Freenode
>> ---
>> 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].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/vagrant-up/CA%2BonWPeRGfhrTM6Wy_WMe_FiVnH6ueg8iNm-Xs_qQ7tPRzPZ8A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/vagrant-up/CA%2BonWPeRGfhrTM6Wy_WMe_FiVnH6ueg8iNm-Xs_qQ7tPRzPZ8A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/CAHqq0ewia9ZUSqE1_cp8FbL%2BszW-iYyxW7wBw3ZXHzu_sh1uEQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/vagrant-up/CAHqq0ewia9ZUSqE1_cp8FbL%2BszW-iYyxW7wBw3ZXHzu_sh1uEQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CA%2BonWPevPKnD6rqF_5CWOUjjSpe8czMppP31R2sbTKTYk2FPPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to