Skip to content

Linking docks together #1

Open
Open

Description

@klodha

Hi, I happen to watch your presentation over YouTube yesterday. Really very useful and focused on doing it rather than reading. Following the same, I was able to setup docks with mongo, redis and node js. One query I have regarding the same is as docker IP addresses are volatile, how we should link mongo, redis with node? Should we use ENV option or is there any other recommended method.

Activity

  1. InconceivableDuck commented on Aug 5, 2015

    @InconceivableDuck
    Owner

    You are exactly right and networking between containers is a tough one. Docker link is brittle and the IP will change when the container is cycled and break the link. At this moment in time, there is no great work-around. Tools like consul.io add a service discovery layer that will help. Docker networking is on the experimental branch, which will eventually be part of Docker itself and solve a lot of these problems: https://github.com/docker/docker/blob/master/experimental/networking.md

    What we do at Modulus is expose the ports to the host then use DNS that points back to the host itself. We don't use Docker link or any other service discovery layer.

  2. klodha commented on Aug 6, 2015

    @klodha
    Author

    Thanks for quick revert :)

    Could you please share the process of exposing the ports to the host then use DNS that point back to host itself.

    Following your slides, I was able to launch 1 node instance and 1 rabbitmq instance. On my local machine, node container is linked to redis and each page view is incrementing a counter in redis cache. However on local network I can not access node code (as Docker IP is different LAN network ie. not 192.168.1.x). I want to allow other members on team to be able to hit node container using their web browser.

    Regards,
    K

    On 06-Aug-2015, at 12:29 am, InconceivableDuck <notifications@github.com mailto:notifications@github.com> wrote:

    You are exactly right and networking between containers is a tough one. Docker link is brittle and the IP will change when the container is cycled and break the link. At this moment in time, there is no great work-around. Tools like consul.io add a service discovery layer that will help. Docker networking is on the experimental branch, which will eventually be part of Docker itself and solve a lot of these problems: https://github.com/docker/docker/blob/master/experimental/networking.md https://github.com/docker/docker/blob/master/experimental/networking.md
    What we do at Modulus is expose the ports to the host then use DNS that points back to the host itself. We don't use Docker link or any other service discovery layer.

    —
    Reply to this email directly or view it on GitHub #1 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions