Hello You are missing one piece of the puzzle.
When you run Vagrant for docker, you are using a nested setup host -> proxy vm -> docker if you do vagrant up where the vagrant for docker is configured, it will always use a proxy vm If you are on linux it may not use it.. but you can tell vagrant to always use the proxy vm so your host need to connect to the proxy vm, and the proxy vm shoudl fwd the ports to the docker vm on this web: https://docs.vagrantup.com/v2/docker/basics.html read this part: HOST VM On systems that can't run Linux containers natively, such as Mac OS X or Windows, Vagrant automatically spins up a "host VM" to run Docker. This allows your Docker-based Vagrant environments to remain portable, without inconsistencies depending on the platform they are running on. if you want a visual vagrantfile, here is one example I did: docker vm https://github.com/kikitux/hashicorp-demo/blob/master/consul1/docker-dc1/Vagrantfile and here the host where those docker will run: https://github.com/kikitux/hashicorp-demo/blob/master/consul1/host/Vagrantfile hope this helps On Sun, Jun 7, 2015 at 8:07 PM, Señor J Onion <[email protected]> wrote: > Hi - I am new to vagrant (and docker) and have set up a simple Vagrantfile > to start up a rabbitmq instance inside a docker container (using the > official docker image for that). > > I want to connect to the rabbitmq management plugin in my browser on my host > machine - I am on a Mac. I get a connection refused. I am clearly not yet > understanding how perhaps port forwarding works. I am using Vagrant version > 1.7.2 - a fresh install of that and Virtualbox. When I "vagrant up" - > everything starts up fine and docker-logs shows me that rabbit started too. > > This is my Vagrantfile > > Vagrant.require_version ">= 1.6.0" > ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker' > > Vagrant.configure("2") do |config| > > config.vm.synced_folder ".", "/vagrant", type: "rsync", > rsync__exclude: ".git/", disabled: false > > config.vm.provider "docker" do |docker| > docker.image = "rabbitmq:3-management" > docker.ports = ['5672:5672', '15672:8080'] # host:container > docker.name = 'rabbitmq' > docker.create_args = ['-e', 'RABBITMQ_NODENAME=johnny-is-a-rabbit'] > end > > config.ssh.insert_key = false > end > > > Please can somebody let me know what URL to use in my browser so that I can > see the rabbitmq management plugin ... Or what changes I would need to make > to the Vagrantfile for this to work > (I have tried localhost:15672 and localhost:8080 ...) > > -- > 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.
