Commit Graph

39 Commits

Author SHA1 Message Date
d0893cb64b Tidy driver.go/LinkContainers
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: 38a595aec561b8a7b4325b6c1c4efd1b0b8e89c0
Component: engine
2014-12-21 13:42:02 +10:00
4b105a7583 Create tests for pkg/iptables
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: 0da92633b4161ed1f8babe5ec4a9fe98257d34b5
Component: engine
2014-12-21 12:57:32 +10:00
ae55b92633 Create DOCKER forward chain on driver init
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: 2865373894f1532fa725481e8f04db4a5d7a0aa8
Component: engine
2014-12-21 12:57:32 +10: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
9254581bd3 Try other port on any error from Map
Sometimes other programs can bind on ports from our range, so we just
skip this ports on allocation.

Fixes #9293
Probably fixes #8714

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a00a1a1fca020d21cb677439160e018bda5c3835
Component: engine
2014-12-01 16:26:30 -08:00
95c96f42c9 Merge pull request #9149 from swagiaal/fix-configureBridge-comment
Remove reference to 'ifaceName' from configureBridge comment.
Upstream-commit: a43ee077dca75d0e8f198275db17eac341b0ca8c
Component: engine
2014-11-21 16:37:28 -05:00
c878d4a442 Apply same typed iptables errors to network driver.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: f6c7194539720473aae814d3d1445eab2a78d568
Component: engine
2014-11-20 18:07:15 -08:00
9224549fdb Remove reference to 'ifaceName' from configureBridge comment.
The argument ifaceName was removed in a much earlier commit.

Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
Upstream-commit: a01f1e707eb682ec60d489a4171d2c82de79ee57
Component: engine
2014-11-13 10:19:56 -05: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
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
deaa163ba3 Gracefully handle network bridge without IP association at startup
Addresses #8444

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 1262b5f605e8f897acb2b9ee261edbab7f1f8947
Component: engine
2014-10-23 16:19:12 -04:00
4418404026 Support for consistent MAC address.
Right now, MAC addresses are randomly generated by the kernel when
creating the veth interfaces.

This causes different issues related to ARP, such as #4581, #5737 and #8269.

This change adds support for consistent MAC addresses, guaranteeing that
an IP address will always end up with the same MAC address, no matter
what.

Since IP addresses are already guaranteed to be unique by the
IPAllocator, MAC addresses will inherit this property as well for free.

Consistent mac addresses is also a requirement for stable networking (#8297)
since re-using the same IP address on a different MAC address triggers the ARP
issue.

Finally, this change makes the MAC address accessible through docker
inspect, which fixes #4033.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 88e21c6a75310da158bbee3a5fdc135697c93ba1
Component: engine
2014-10-03 13:22:38 -07:00
5f2492cd77 Merge pull request #8125 from somaopensource/8102-fix
Check whether net.ParseIP returned nil or not
Upstream-commit: 4778d7d52d97666b3c7d886861f30a39ecc1bb24
Component: engine
2014-09-22 23:00:25 +04:00
eb02e608df Merge pull request #6101 from LK4D4/ip_range_#4986
Implement allocating IPs from CIDR within bridge network 
Upstream-commit: 9fb34ae5710faaadc730a7005f785cefc56eed4b
Component: engine
2014-09-22 17:09:16 +03:00
d6c649f11a Check whether net.ParseIP returned nil or not
This is fix of #8102

Signed-off-by: Oh Jinkyun <tintypemolly@gmail.com>
Upstream-commit: c2dc4245f1fb9462d0f22e0bc2aceb02903211ab
Component: engine
2014-09-22 16:52:23 +09:00
3a9c8d29c9 This reduces the amount of logging in the integration tests
There were a new areas in the brige driver that did not need to have log
output.  Those were removed.  Also set the engine's logging to false
when running the integration tests.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 8a9e827216eb5db4fcbe67c3c638f9e85f4de9bf
Component: engine
2014-09-19 17:30:37 -07:00
9ba82afe29 Add an option to disable IP masquerading
For the cases where --bip option is used it is sometimes best to disable
IP masquerading as the provided bridge IP range may be routable.

Signed-off-by: Eugene Yakubovich <eugene.yakubovich@coreos.com>
Upstream-commit: 4dc4d56db9797159e2e329845e0b94e3e0f780a0
Component: engine
2014-09-16 20:00:15 -07:00
b1d4f5b84e Implement allocating IPs from CIDR within bridge network
Fixes #4986

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: b101022dbe6daa36ebf11df53ad01a399a655963
Component: engine
2014-08-29 16:21:07 +04:00
b6b24f8f8a More ipallocator refactoring
Now x1.5 faster

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 42dd48315fcf6a3a536e0e698396e404246b9f3f
Component: engine
2014-08-29 16:20:49 +04:00
0bb709c134 remove double newline
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: fcf37be2b1efa11da1958658da0e04755a225c89
Component: engine
2014-08-14 01:08:27 +00:00
4737f7cea5 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
Upstream-commit: a02f67be5b17da63d475e6f35956c1e72c3b2e7b
Component: engine
2014-08-13 15:18:15 -07:00
b3e9a7cd3b Move userland proxies out of daemon's process
This PR moves the userland proxies for TCP and UDP traffic out of the
main docker daemon's process ( from goroutines per proxy ) to be a
separate reexec of the docker binary.  This reduces the cpu and memory
needed by the daemon and if the proxy processes crash for some reason
the daemon is unaffected.  This also displays in the standard process
tree so that a user can clearly see if there is a userland proxy that is
bound to a certain ip and port.

```bash
CONTAINER ID        IMAGE                       COMMAND             CREATED             STATUS              PORTS                                          NAMES
5d349506feb6        busybox:buildroot-2014.02   "sh"                13 minutes ago      Up 1 seconds        0.0.0.0:49153->81/tcp, 0.0.0.0:49154->90/tcp   hungry_pike
root@1cbfdcedc5a7:/go/src/github.com/docker/docker# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  18168  3100 ?        Ss   21:09   0:00 bash
root      8328  0.7  0.6 329072 13420 ?        Sl   22:03   0:00 docker -d -s vfs
root      8373  1.0  0.5 196500 10548 ?        Sl   22:03   0:00 userland-proxy -proto tcp -host-ip 0.0.0.0 -host-port 49153 -container-ip 10.0.0.2 -container-port 81
root      8382  1.0  0.5 270232 10576 ?        Sl   22:03   0:00 userland-proxy -proto tcp -host-ip 0.0.0.0 -host-port 49154 -container-ip 10.0.0.2 -container-port 90
root      8385  1.2  0.0   3168   184 pts/0    Ss+  22:03   0:00 sh
root      8408  0.0  0.1  15568  2112 ?        R+   22:03   0:00 ps aux
```

This also helps us to cleanly cleanup the proxy processes by stopping
these commands instead of trying to terminate a goroutine.

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: b4e2f5ed962f8ef81dbc2cbb1ff2a06bb64f8211
Component: engine
2014-08-13 11:54:47 -07:00
e25f77248d Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4398108433121ce2ac9942e607da20fa1680871a
Component: engine
2014-07-29 13:09:10 -07:00
2273fb0f55 gofmt -s -w
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 5a0ef08c940b9a17c400389bca8e7f54935ceba9
Component: engine
2014-07-24 22:25:29 +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
d2349e06da Change switch to if so that the break statements correctly breaks loop
Docker-DCO-1.1-Signed-off-by: Kohei Tsuruta <coheyxyz@gmail.com> (github: coheyxyz)
Upstream-commit: ffe885ec0e8a06c1614949bf383f6d1532f02c1d
Component: engine
2014-07-17 20:27:29 +09:00
6a68c558b1 Merge pull request #6371 from jpetazzo/6370-masquerade
Select masquerade by outgoing interface rather than by destination subne...
Upstream-commit: bcec0f30e8d7dbb9fcdd6a85fa4b8e4953ba66ff
Component: engine
2014-07-07 10:28:31 -07:00
4ad46ffe31 Use last allocated port logic in port allocator
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: e77729c2e081c5ce55aa1d4f316b7c7703e5de96
Component: engine
2014-06-27 10:51:26 -07:00
52ddc2736f Make ErrPortAlreadyAllocated an error interface with a few extras,
adjust tests to fit.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: ffd68badc0a3d70fbd063903702355a387621b10
Component: engine
2014-06-27 10:51:25 -07:00
187971736c Restrict portallocator to Docker allocated ports
Port allocation status is stored in a global map: a port detected in use will remain as such for the lifetime of the daemon. Change the behavior to only mark as allocated ports which are claimed by Docker itself (which we can trust to properly remove from the allocation map once released). Ports allocated by other applications will always be retried to account for the eventually of the port having been released.

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <icecrime@gmail.com> (github: icecrime)
Upstream-commit: dafddf461eeabd792d9ced6caced75ad6961c1d7
Component: engine
2014-06-27 10:51:25 -07:00
363db75bc0 Select masquerade by outgoing interface rather than by destination subnet
Docker-DCO-1.1-Signed-off-by: Jérôme Petazzoni <jerome@docker.com> (github: jpetazzo)
Upstream-commit: a084f4bc61a81eb9076246d85d6cc5168b32a949
Component: engine
2014-06-11 17:09:19 -07:00
52b8a282c3 Update libcontainer imports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8194556337b65dda71a3d4d7f6ae9653ad5a19a0
Component: engine
2014-06-10 19:58:15 -07:00
3c7670e68c Move libcontainer deps into libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 6158ccad97db51e756aafefb096d1163aa4d6439
Component: engine
2014-06-09 15:52:12 -07:00
bfa0c1d204 Fix races in set/get currentInterfaces in networkdriver
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: 4e5f6951f2af836c3d9163c8a150298ee87468d4
Component: engine
2014-05-30 14:16:00 +04:00
1e8e32fb77 bridge: retry any proxy set up failures until we get a successful port, defeats a race condition
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 91ba3379312a74132e2578d167c9e36eeb889525
Component: engine
2014-05-21 09:14:53 -07:00
ac35d8965e add resolvconf
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 3744452ecf46351758478e99795e20b186a1bee4
Component: engine
2014-05-05 22:55:32 +00:00
74d365d59a Fix bridge ip comparison
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: 986c647d5ac9bda0633cdeb927bb782d8df02269
Component: engine
2014-04-30 12:36:16 -07:00
f7be50364d Rename runtime/* to daemon/*
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 359b7df5d2af5733b8a1ea6746d062053053b23e
Component: engine
2014-04-17 14:43:01 -07:00