Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker.network resource #298

Closed
ryane opened this issue Sep 22, 2016 · 2 comments · Fixed by #477
Closed

docker.network resource #298

ryane opened this issue Sep 22, 2016 · 2 comments · Fixed by #477
Milestone

Comments

@ryane
Copy link
Contributor

ryane commented Sep 22, 2016

Support for creating docker networks. Currently with Converge, you can only configure communication between containers using the legacy links feature.

@BrianHicks BrianHicks added this to the 0.4.0 milestone Oct 20, 2016
@BrianHicks
Copy link
Contributor

@ryane could you sketch out what this and #299 would look like in concert with the rest of the Docker modules?

@ryane
Copy link
Contributor Author

ryane commented Oct 25, 2016

example hcl for a docker.network resource:

docker.network "elk" {
  name = "elk"

  # optional
  driver      = "bridge"
  subnet      = "192.168.123.0/24"
  gateway     = "192.168.123.1"
  ip_range    = "192.168.123.0/28"
  internal    = false
  ipam_driver = ""
  enable_ipv6 = false

  aux_address {
    router  = "192.168.123.5"
    printer = "192.168.123.4"
  }

  labels {
    name = "elk"
    env  = "production"
  }

  options {
    "com.docker.network.bridge.enable_icc"           = "true"
    "com.docker.network.bridge.enable_ip_masquerade" = "true"
  }

  ipam_options {}

  force = true # will recreate the network if one with the same name exists and has diffs
}

A container would be able to connect to that network with a lookup:

docker.container "elasticsearch-container" {
  name    = "elasticsearch"
  image   = "elasticsearch:2.4.0"
  network = "{{lookup `docker.network.elk.name`}}"
  force   = "true"
}

Thoughts?

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

Successfully merging a pull request may close this issue.

2 participants