Docker to VM Networking

We have been migrating part of our system over to a more microservice-orientated architecture. To run this, we have opted to run them as docker containers. Our architecture at the moment is as follows:

a) Several web servers, hosting the still monolithic PHP application

  • How to open jupyter nookbooks in docker container?
  • Minimal configuration for Apache reverse proxy in Docker container
  • Mount a Virtualbox shared folder as a volume for Docker running on the guest OS
  • AOT Compiler to Shrink Docker Container
  • Gradle not able to download andriod packages
  • docker hub images tags are not showing using automated build from github organisation repo
  • b) 3 new VM’s, which will run

    • An “alerting” microservice
    • A mongo DB instance
    • A custom microservice registry (based on redis)

    So, my problem is as follows:

    Our current infrastructure is all in the 10.0.0.0/24 range. Docker spins up instances in the 172.x.1.x range. How do I get the web servers (running on 10.0.0.0/24) to connect to the services registered with the “registry”, which is at 172.17.1.3 (for example)?

    I’ve read up about lots of extensions, such as swarm, compose, etc. But those don’t seem to solve the networking problem.

    You might say “well you’re already exposing the relevant port on the alerting service, just connect to that VM’s IP address”, but the problem is that when the service (i.e. the NodeJS application inside the docker container) starts up, it registers its exposed port with the service “registry”. The registry uses the requesting IP address to build up a sort of path. So the service starts up, and gets registered in the “registry” as 172.17.1.5:3001. If this is the only way, is there not a way to get the services’ host IP address?

    Any suggestions? Hope this makes sense!

    Thanks for any help!

  • AWS Elastic Beanstalk Application and Static Assets Deployment Isolation
  • Exception occuring when updating database schema in symfony
  • Edit source code in Docker
  • Structure of Angular / NodeJS repository which will run in docker
  • best way to send docker container logs to logstash
  • Docker tag flag not working when building from Dockerfile
  • One Solution collect form web for “Docker to VM Networking”

    The registry uses the requesting IP address to build up a sort of path. So the service starts up, and gets registered in the “registry” as 172.17.1.5:3001. If this is the only way, is there not a way to get the services’ host IP address?

    If those containers are running on the same host (running one docker daemon), you don’t need a registry, as all containers sees each other through a common docker network (that docker-compose creates by default in its version 2)

    If those containers are running on the different hosts (each running their own docker daemon), you need one more key-value store in order to enable docker container visibility across VMs, allowing you to resolve a container name to its right ip across hosts.
    See “How to make Docker container accessible to other network machines through IP?” and this tutorial.

    http://i.stack.imgur.com/ahLaf.png

    That could replace your redis registry.

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