Support hairpin NAT without going through docker server

Hairpin NAT is currently done by passing through the docker server.  If
two containers on the same box try to access each other through exposed
ports and using the host IP the current iptables rules will not match the
DNAT and thus the traffic goes to 'docker -d'

This change drops the restriction that DNAT traffic must not originate
from docker0.  It should be safe to drop this restriction because the
DOCKER chain is already gated by jumps that check for the destination
address to be a local address.

Docker-DCO-1.1-Signed-off-by: Darren Shepherd <darren.s.shepherd@gmail.com> (github: ibuildthecloud)
Prevent dynamic allocation of previously allocated ports

Docker-DCO-1.1-Signed-off-by: Andy Kipp <andy@rstudio.com> (github: kippandrew)
Better test error message

Docker-DCO-1.1-Signed-off-by: Andy Kipp <andy@rstudio.com> (github: kippandrew)
Be more explicit in finding next port to allocate

Docker-DCO-1.1-Signed-off-by: Andy Kipp <andy@rstudio.com> (github: kippandrew)
Add err checks for port allocator tests

Docker-DCO-1.1-Signed-off-by: Andy Kipp <andy@rstudio.com> (github: kippandrew)
docker save: --output flag

for those that do not care to redirect stdout

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
docker save: add and improve docs

add usage examples for `docker save ...`

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
api/client: var style tweak

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Harmonize / across all name-related commands

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)

Harmonize / across all name-related commands

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)

Harmonize / across all name-related commands:Return an error when repeated /

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)
I'm not looking forward to documenting cli arguments that may or may not show depending on what plugins / drviers you choose

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
devicemapper: Better/faster shutdown

Right now shutdown is looping over *all* devicemapper
devices and actively deactivating them, this is pretty
slow if you have a lot of non-active containers. We
instead only deactivate the devices that are mounted.

We also do the shutdown unmount using MNT_DETACH which
forces the unmount in the global namespace, even if it
is busy because of some container having it mounted.
This means the device will be freed when that container
exits.

Also, we move the call to waitClose to deactivateDevice
because all callers of any of them call both anyway.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Harmonize / across all name-related commands/Validate images names

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)
Add mention of mounting cgroupfs properly to PACKAGERS.md

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Revert "fix failing test to use kill instead of stop"

This reverts commit 4434dcee89f7d0d0239f6b492b24e940cdbafb21.

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Revert "Disable automatic killing of containers when docker stop fails"

This reverts commit 8b5cf51d600dc4f3611cf063c52cf3448e7b01e5.

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
As far as I know this code is not used or maintained
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Promote btrfs
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Workaround for hanging events. Fixes #4804

Docker-DCO-1.1-Signed-off-by: LK4D4 <lk4d4math@gmail.com> (github: LK4D4)
Merge pull request #4832 from LK4D4/fix_events_hanging_#4804

Workaround for hanging events. Fixes #4804
Merge pull request #4835 from crosbymichael/reverst-stop-kill

Revert back to the default stop functionality of SIGKILL after timeout