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

  • Docker warning: failed to get default registry endpoint from daemon
  • How important is a small Docker image when running?
  • How to make pull public and push requiring login in docker registry v2?
  • Custom DOCKER_HOST in Elastic Beanstalk Docker environment
  • Jenkinsfile maven plugin inside a docker container
  • Docker compose bind container to interface
  • Vagrant tells me on vagrant up that (host) port 5000 is already in use.

  • Should I Compile My Application Inside of a Docker Image
  • Is this Docker / NGINX / Node setup actually load balancing as expected?
  • Use real server instead of docker-machine for OSX
  • Docker: mounting volumes from other docker service (not container)
  • Why set VISIBLE=NOW in /etc/profile?
  • Doubts about Docker with dcm4chee
  • One Solution collect form web for “share ports between docker and vagrant”

    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.