Commit Graph

13 Commits

Author SHA1 Message Date
13426de5e6 Docker integration with libnetwork
- Updated Dockerfile to satisfy libnetwork GOPATH requirements.
    - Reworked daemon to allocate network resources using libnetwork.
    - Reworked remove link code to also update network resources in libnetwork.
    - Adjusted the exec driver command population to reflect libnetwork design.
    - Adjusted the exec driver create command steps.
    - Updated a few test cases to reflect the change in design.
    - Removed the dns setup code from docker as resolv.conf is entirely managed
      in libnetwork.
    - Integrated with lxc exec driver.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: d18919e304c240df84502cdcc5ed655d92d12d4f
Component: engine
2015-05-19 22:40:19 +00:00
860e8ba926 Fix firewalld callback.
It needs to be called with same args as the one 4 lines above.

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
Upstream-commit: 6e8cfd63fcbf6d64b475b387cc66689582cc81c1
Component: engine
2015-05-07 10:08:49 +02:00
1e118310a9 A fix for = in env values in linked containers
Closes: #12763

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: bc149be69c5ad22f82269427dd4b4aed9df4fa40
Component: engine
2015-04-25 04:42:43 -07:00
fcda625311 React to firewalld's reload/restart
When firewalld (or iptables service) restarts/reloads,
all previously added docker firewall rules are flushed.

With firewalld we can react to its Reloaded() [1]
D-Bus signal and recreate the firewall rules.
Also when firewalld gets restarted (stopped & started)
we can catch the NameOwnerChanged signal [2].
To specify which signals we want to react to we use AddMatch [3].

Libvirt has been doing this for quite a long time now.

Docker changes firewall rules on basically 3 places.
1) daemon/networkdriver/portmapper/mapper.go - port mappings
   Portmapper fortunatelly keeps list of mapped ports,
   so we can easily recreate firewall rules on firewalld restart/reload
   New ReMapAll() function does that
2) daemon/networkdriver/bridge/driver.go
   When setting a bridge, basic firewall rules are created.
   This is done at once during start, it's parametrized and nowhere
   tracked so how can one know what and how to set it again when
   there's been firewalld restart/reload ?
   The only solution that came to my mind is using of closures [4],
   i.e. I keep list of references to closures (anonymous functions
   together with a referencing environment) and when there's firewalld
   restart/reload I re-call them in the same order.
3) links/links.go - linking containers
   Link is added in Enable() and removed in Disable().
   In Enable() we add a callback function, which creates the link,
   that's OK so far.
   It'd be ideal if we could remove the same function from
   the list in Disable(). Unfortunatelly that's not possible AFAICT,
   because we don't know the reference to that function
   at that moment, so we can only add a reference to function,
   which removes the link. That means that after creating and
   removing a link there are 2 functions in the list,
   one adding and one removing the link and after
   firewalld restart/reload both are called.
   It works, but it's far from ideal.

[1] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.Signals.Reloaded
[2] http://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-name-owner-changed
[3] http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
[4] https://en.wikipedia.org/wiki/Closure_%28computer_programming%29

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
Upstream-commit: b052827e025267336f0d426df44ec536745821f8
Component: engine
2015-04-20 13:02:09 +02:00
b706b2d562 Remove engine from links
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 7560018541192ebdfe16e39515f9a04b44635d84
Component: engine
2015-04-12 16:25:10 +02:00
0c091d906f Remove jobs from daemon/networkdriver/bridge
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 53582321ee502335a9c3be4789bef984e09f77c4
Component: engine
2015-04-08 18:50:29 -04:00
9976dfdd89 Env Variables created for each of the ports in addition to env variables for port ranges, regression from #1834
Closes #9900
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 611a23aa7f443284fbbbb80716c46159e438bf52
Component: engine
2015-01-15 19:16:31 +00:00
c720d69487 Move per-container forward rules to DOCKER chain
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: cc89b30d35edc02fc598a0b26fe7a1ed002238e4
Component: engine
2014-12-21 12:57:32 +10:00
b972337ce2 adding support for port ranges on --expose
Closes #1834

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: fd774a818c7d8942922b4f74eabd2a4e14094e1a
Component: engine
2014-10-31 23:06:30 +00:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
28d12ecd02 Replace dashes in link name with underscores
Docker-DCO-1.1-Signed-off-by: Jonathan Camp <jonathan@irondojo.com> (github: kung-foo)
Upstream-commit: 6e74754a504e80378ed56ec765d62b762f80fcb4
Component: engine
2014-06-24 09:04:02 +02:00
3e5bd59386 Extract our default PATH value to a constant for great reuse
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: b3ffc1f8358a9aa89448b37ea630c5783f0672d8
Component: engine
2014-02-22 20:01:45 -07:00
a10cdc2a0c Move links to sub pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 147b09fae9527e760d74b5ef2f9558ee109f4009
Component: engine
2014-02-14 18:18:16 -08:00