Add a 'docker fingerprint' command for signing images

The "should we do this" discussion starts in #2700 [1] (where it still
hasn't reached a consensus).  The goal here is to implement:

     $ docker fingerprint <namespace>/<name>[:<tag>]
     <namespace>/<name>:<tag>
     <metadata>
     <own tarsums> 

The tarsum should be the tarsum of the assembled image (squashing all
layers), not the tarsum of the tip layer.

The current implementation is a work in progress.  I'm still not clear
on how the whole server/job API is supposed to get wired together, and
have been basically pattern-matching off 'git grep -i history'.  I'm
posting the WIP branch because I won't have time to work on it for the
next few days, and wanted to open it up in case anyone else wanted to
chip in.

[1]: https://github.com/dotcloud/docker/issues/2700#issuecomment-42474265

https://github.com/dotcloud/docker/issues/2700#issuecomment-42474265
On Wed, Jul 02, 2014 at 11:10:23AM -0700, Johan Euphrosine wrote:
> > @@ -251,6 +251,20 @@ func getEvents(eng *engine.Engine, version version.Version, w http.ResponseWrite
> >  	return job.Run()
> >  }
> >  
> > +func getImagesFingerprint(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
> > +	if vars == nil {
> > +		return fmt.Errorf("Missing parameter")
> 
> maybe be more explicit about the parameter you're expecting.

That's just copy-pasted from getImagesHistory.  I'm fine changing it
(it seems like we only use vars["name"]), but I think consistency in
the Docker source is also important.