Update daemon and docker core to use new content addressable storage

Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.

Add v1 migration code.

Update registry, api/*, and daemon packages to use the reference
package's types where applicable.

Update daemon package to use image/layer/tag stores instead of the graph
package

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2015-11-18 14:20:54 -08:00 committed by Aaron Lehmann
parent 0fb39140d9
commit 2c84dccd2d
3 changed files with 4 additions and 50 deletions

View file

@ -7,6 +7,7 @@ import (
"io"
"regexp"
"strconv"
"strings"
"github.com/docker/docker/pkg/random"
)
@ -25,6 +26,9 @@ func IsShortID(id string) bool {
// In case of a collision a lookup with TruncIndex.Get() will fail, and the caller
// will need to use a langer prefix, or the full-length Id.
func TruncateID(id string) string {
if i := strings.IndexRune(id, ':'); i >= 0 {
id = id[i+1:]
}
trimTo := shortLen
if len(id) < shortLen {
trimTo = len(id)