Add 'docker.io' and 'index.docker.io' to default registry matcher

Signed-off-by: Michal Fojtik <mfojtik@redhat.com>
This commit is contained in:
Michal Fojtik
2015-05-27 16:07:08 +02:00
parent 6fa2777e26
commit 9a94f7cc38
2 changed files with 29 additions and 0 deletions

View File

@@ -106,11 +106,20 @@ const defaultRegistryHost = "index.docker.io/v1/"
func isDefaultRegistryMatch(image string) bool {
parts := strings.SplitN(image, "/", 2)
if len(parts[0]) == 0 {
return false
}
if len(parts) == 1 {
// e.g. library/ubuntu
return true
}
if parts[0] == "docker.io" || parts[0] == "index.docker.io" {
// resolve docker.io/image and index.docker.io/image as default registry
return true
}
// From: http://blog.docker.com/2013/07/how-to-use-your-own-registry/
// Docker looks for either a “.” (domain separator) or “:” (port separator)
// to learn that the first part of the repository name is a location and not