fanti
fanti

Reputation: 1927

share ports between docker and vagrant

How do I share guest ports between vagrant and docker (docker standalone, not as vagrant provider)?

I tried: docker guest 5000 <> host 5000 <> vagrant guest 5000

Vagrant tells me on vagrant up that (host) port 5000 is already in use.

Upvotes: 0

Views: 104

Answers (1)

Chris McKinnel
Chris McKinnel

Reputation: 15092

You can't have two things listen on the same port unless you have two network cards in your machine. Because you're running your docker container that is exposing port 5000 and your vagrant box exposes port 5000, you're getting a conflict.

You will have to expose a different port on one or the other if you want them both to run at the same time.

Upvotes: 1

Related Questions