Fix link for configuring automated builds
TarSum: versioning

This introduces Versions for TarSum checksums.
Fixes: https://github.com/docker/docker/issues/7526

It preserves current functionality and abstracts the interface for
future flexibility of hashing algorithms. As a POC, the VersionDev
Tarsum does not include the mtime in the checksum calculation, and would
solve https://github.com/docker/docker/issues/7387 though this is not a
settled Version is subject to change until a version number is assigned.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Merge pull request #7689 from vbatts/vbatts-tarsum_versioning

TarSum: versioning
Merge pull request #7975 from passy/patch-2

Fix link for configuring automated builds
engine: Make Engine threadsafe

This allows registering handlers after you've started using the engine,
as well as setting hack envs.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Add generic /cmd entrypoint w/ cli support

If you do
  docker devmapper:resize -o Key=Value -o Foo=Bar plugin:op arg1 arg2

This will do a GET http request to /cmd/devmapper/resize with the
arguments and options as keys. This will then try to spawn a job on
the engine called "devmapper:resize" with the arg1, arg2, etc as
arguments and the -o options as environment.

Also, any graph driver implementing the engine.Installer interface
will get installed on the engine when the daemon is created.

This will be used by e.g. the devicemapper to allow driver-specific
operations like pool resizing.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
 devicemapper: Add resize-pool operation

This lets you live-resize the devicemapper loopback files for the pool.
Use it like this:
 docker dm:resize-pool 140G

Also, it changes the way pool sizes are reported to use the units.HumanSize
call which uses base 1000, not 1024, to match the FromHumanSize call.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
devicemapper: Add docker driver resize operations

This lets you resize individual images or containers like:

docker dm:resize f4eff8c9f36d3114c3a16fc7b213512153a2d25caef6f11f385020e6558600f1 12G

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
devicemapper: Split out BlockDeviceDiscard

This adds a BlockDeviceDiscardAll which discards everything on the device,
and makes BlockDeviceDiscard take offset and length arguments.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
devicemapper: Add dm:trim-pool command

This command suspends the pool, extracts all metadata from the
metadata pool and then manually discards all regions not in use on the
data device. This will re-sparsify the underlying loopback file and
regain space on the host operating system.

This is required in some cases because the discards we do when
deleting images and containers isn't enought to fully free all space
unless you have a very new kernel.  See:
https://github.com/dotcloud/docker/issues/3182#issuecomment-32888284

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)