From 287cf41118c281e99dbc99c3c45accaa0040fa22 Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 15 May 2015 17:48:20 -0700 Subject: [PATCH] Registry v2 mirror support. The v2 registry will act as a pull-through cache, and needs to be handled differently by the client to the v1 registry mirror. See docker/distribution#459 for details Configuration Only one v2 registry can be configured as a mirror. Acceptable configurations in this chanage are: 0...n v1 mirrors or 1 v2 mirror. A mixture of v1 and v2 mirrors is considered an error. Pull If a v2 mirror is configured, all pulls are redirected to that mirror. The mirror will serve the content locally or attempt a pull from the upstream mirror, cache it locally, and then serve to the client. Push If an image is tagged to a mirror, it will be pushed to the mirror and be stored locally there. Otherwise, images are pushed to the hub. This is unchanged behavior. Signed-off-by: Richard Scothern --- docs/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/config.go b/docs/config.go index 568756f4e..92ef4d997 100644 --- a/docs/config.go +++ b/docs/config.go @@ -189,7 +189,7 @@ func ValidateMirror(val string) (string, error) { return "", fmt.Errorf("Unsupported path/query/fragment at end of the URI") } - return fmt.Sprintf("%s://%s/v1/", uri.Scheme, uri.Host), nil + return fmt.Sprintf("%s://%s/", uri.Scheme, uri.Host), nil } // ValidateIndexName validates an index name. @@ -358,7 +358,9 @@ func (config *ServiceConfig) NewRepositoryInfo(reposName string) (*RepositoryInf // *TODO: Decouple index name from hostname (via registry configuration?) repoInfo.LocalName = repoInfo.Index.Name + "/" + repoInfo.RemoteName repoInfo.CanonicalName = repoInfo.LocalName + } + return repoInfo, nil }