Skip to content

Proposal: Links: Dynamic Links #7468

@erikh

Description

@erikh

This is a two part proposal. Please see #7467 for the other part.

Problem

Links currently do not satisfy the needs of users for a couple of reasons:

  • linking is static: you cannot change the associations links provide without destroying (at least one) container
  • docker’s links system externally does not provide an elegant UI to manipulating and querying links

Solution:

  • Provide new docker links UI
  • Provide guarantees about what happens when a link is added or removed

New docker links UI

Four new inferior commands will be added under the new subcommand docker links

  • docker links list - list the existing links, and the state of the linked containers
  • docker links add <consumer> <producer> <name> - add a link to existing containers
  • docker links remove <name> - remove a link from existing containers
  • docker links move <name> <producer2> - to migrate a set of links from one container to another

Links Guarantees

We should guarantee that:

  • Adding a link should:
    • rewrite the hosts files for all linked resources with updated content
    • expose the ports described in the Dockerfile
  • Removing a link should:
    • rewrite the hosts files for all linked resources with updated content
    • tear down the exposed ports brought by docker links add

Tickets Resolved:

#5186
#2733
#3285
#3155
#2658
#2588 (I think)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions