Goroutine-safe daemon.containers

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Atomically increment sequence in pkg/netlink

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Merge pull request #6118 from LK4D4/fix_race_conditions

Fix race conditions
Documented special case of container memory limits in manpages

If a container is started with a memory limit of 0, no memory limit is applied.
To prevent this from causing confusion, make interaction explicit in docs.

Docker-DCO-1.1-Signed-off-by: Matthew Heon <mheon@redhat.com> (github: mheon)
optimize restore & use Getenv less in daemon.go

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Merge pull request #6121 from unclejack/refactor_daemon_restore

optimize restore & use Getenv less in daemon.go
no default default number in names

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Refactor device handling code

We now have one place that keeps track of (most) devices that are allowed and created within the container.  That place is pkg/libcontainer/devices/devices.go

This fixes several inconsistencies between which devices were created in the lxc backend and the native backend.  It also fixes inconsistencies between wich devices were created and which were allowed.  For example, /dev/full was being created but it was not allowed within the cgroup.  It also declares the file modes and permissions of the default devices, rather than copying them from the host.  This is in line with docker's philosphy of not being host dependent.

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
use stderr to debug iptables

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Merge pull request #6065 from vieux/fix_race_waitlock

update container's state after we close the waitLock
Merge pull request #6124 from vieux/standadize_debug_iptables

use stderr to debug iptables
Merge pull request #6123 from vieux/no_number_default

no default default number in names
Merge pull request #5947 from glebfm/fix-socket-race-condition

Fix race condition during socket creation
reuse timestamp, don't call time.Now() 3 times

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Merge pull request #6127 from unclejack/reuse_timestamp

reuse timestamp, don't call time.Now() 3 times
Merge pull request #6097 from timthelion/consistentdevices

Refactor device handling code
Init database if empty file
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Standardize API keys: CamelCase

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
update docs

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Ensure all dev nodes are copied for privileged

This also makes sure that devices are pointers to avoid copies
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)