Add --log-level support

Next steps, in another PR, would be:
- make all logging go through the logrus stuff
- I'd like to see if we can remove the env var stuff (like DEBUG) but we'll see

Closes #5198

Signed-off-by: Doug Davis <dug@us.ibm.com>

Docker-DCO-1.1-Signed-off-by: Doug Davis <dug@us.ibm.com> (github: jfrazelle)
fixed the way of iterating over the range of map.

Fixed the following errors:
1. Request(0) causes a dead loop when the map is full and map.last == BEGIN.
2. When map.last is the only available port (or ip), Request(0) returns ErrAllPortsAllocated (or ErrNoAvailableIPs). Exception is when map.last == BEGIN.

Signed-off-by: shuai-z <zs.broccoli@gmail.com>

Docker-DCO-1.1-Signed-off-by: shuai-z <zs.broccoli@gmail.com> (github: jfrazelle)
Remove obsolete comments
In the below comment line, already codes for log exists so
following comment is obsolete.
// TODO log

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>

Docker-DCO-1.1-Signed-off-by: Daehyeok Mun <daehyeok@gmail.com> (github: jfrazelle)
Update libcontainer to 28cb5f9dfd6f3352c610a4f1502

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Docker-DCO-1.1-Signed-off-by: Michael Crosby <crosbymichael@gmail.com> (github: jfrazelle)
makes the -s --size option documentation clearer #8950

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: jfrazelle)
Fix the documentation and integration test for container resize
Closes #8728

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>

Docker-DCO-1.1-Signed-off-by: Srini Brahmaroutu <sbrahma@us.ibm.com> (github: jfrazelle)
Add test for bug (9056) where rmi -f fails with "no such id".

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Fix for rmi -f when error "no such id". (9056)

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
pkg/mount: include optional field

one linux, the optional field designates the sharedsubtree information,
if any.

Signed-off-by: Vincent Batts <vbatts@redhat.com>

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: jfrazelle)
pkg/mount: testing mountinfo fields

Signed-off-by: Vincent Batts <vbatts@redhat.com>

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: jfrazelle)
Fix misspelling
Fix misspelling from independant to independent

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>

Docker-DCO-1.1-Signed-off-by: Daehyeok Mun <daehyeok@gmail.com> (github: jfrazelle)
Consistently use sudo docker

Signed-off-by: Satnam Singh <satnam@raintown.org>

Docker-DCO-1.1-Signed-off-by: Satnam Singh <satnam@raintown.org> (github: jfrazelle)
print everything except progress in non-terminal

Instead of only checking `Progress != nil` (which is always true because
the server sends `"progressDetail":{}` when it doesnt have the progress), we
also check if `Progress.String() != ""`, which should be sufficient to filter
out the progress data.

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: jfrazelle)
Fix steam where it should be stream.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Add CONFIG_OVERLAYFS_FS to check-config.sh

Also, added some slight adjustment to the AUFS_FS output/note to make it more clear what it applies to.

Example output:
```console
$ ./contrib/check-config.sh
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_MACVLAN: enabled
- CONFIG_VETH: enabled
- CONFIG_BRIDGE: enabled
- CONFIG_NF_NAT_IPV4: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NF_NAT: enabled
- CONFIG_NF_NAT_NEEDED: enabled

Optional Features:
- CONFIG_MEMCG_SWAP: enabled
- CONFIG_RESOURCE_COUNTERS: enabled
- CONFIG_CGROUP_PERF: missing
- Storage Drivers:
  - "aufs":
    - CONFIG_AUFS_FS: missing
      (note that some kernels include AUFS patches but not the AUFS_FS flag)
    - CONFIG_EXT4_FS_POSIX_ACL: enabled
    - CONFIG_EXT4_FS_SECURITY: enabled
  - "btrfs":
    - CONFIG_BTRFS_FS: enabled
  - "devicemapper":
    - CONFIG_BLK_DEV_DM: enabled
    - CONFIG_DM_THIN_PROVISIONING: enabled
    - CONFIG_EXT4_FS: enabled
    - CONFIG_EXT4_FS_POSIX_ACL: enabled
    - CONFIG_EXT4_FS_SECURITY: enabled
  - "overlayfs":
    - CONFIG_OVERLAYFS_FS: missing
```

Signed-off-by: Andrew Page <admwiggin@gmail.com>

Docker-DCO-1.1-Signed-off-by: Tianon Gravi <admwiggin@gmail.com> (github: jfrazelle)
Update AUTHORS file

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com> (github: jfrazelle)
allow to use x-registry-auth header with enabled cors

Signed-off-by: Vladimir Bulyga <xx@ccxx.cc>

Docker-DCO-1.1-Signed-off-by: Vladimir Bulyga <xx@ccxx.cc> (github: jfrazelle)
LXC TEMPLATE WILL CREATE MOUNT

Lxc driver was throwing errors for mounts where the mount point does not exist in the container.
This adds a create=dir/file mount option to the lxc template, to alleviate this issue.

Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)

Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: jfrazelle)
Cleanup: fixes start response status code typo in examples

Signed-off-by: Andrew C. Bodine <acbodine@us.ibm.com>

Docker-DCO-1.1-Signed-off-by: Andrew C. Bodine <acbodine@us.ibm.com> (github: jfrazelle)
fix link to PACKAGERS.md
fix link from /hack/PACKAGERS.md to /project/PACKAGERS.md

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>

Docker-DCO-1.1-Signed-off-by: Daehyeok Mun <daehyeok@gmail.com> (github: jfrazelle)