Use direct registry url
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
c47aa21c35
commit
f290f44632
@ -14,13 +14,16 @@ import (
|
|||||||
"github.com/docker/docker/utils"
|
"github.com/docker/docker/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
// Where we store the config file
|
// Where we store the config file
|
||||||
const CONFIGFILE = ".dockercfg"
|
CONFIGFILE = ".dockercfg"
|
||||||
|
|
||||||
// Only used for user auth + account creation
|
// Only used for user auth + account creation
|
||||||
const INDEXSERVER = "https://index.docker.io/v1/"
|
INDEXSERVER = "https://index.docker.io/v1/"
|
||||||
|
REGISTRYSERVER = "https://registry-1.docker.io/v1/"
|
||||||
|
|
||||||
//const INDEXSERVER = "https://registry-stage.hub.docker.com/v1/"
|
// INDEXSERVER = "https://registry-stage.hub.docker.com/v1/"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrConfigFileMissing = errors.New("The Auth config file is missing")
|
ErrConfigFileMissing = errors.New("The Auth config file is missing")
|
||||||
|
@ -57,10 +57,14 @@ func getV2URL(e *Endpoint, routeName string, vars map[string]string) (*url.URL,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to make registry route %q with vars %v: %s", routeName, vars, err)
|
return nil, fmt.Errorf("unable to make registry route %q with vars %v: %s", routeName, vars, err)
|
||||||
}
|
}
|
||||||
|
u, err := url.Parse(REGISTRYSERVER)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("invalid registry url: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
return &url.URL{
|
return &url.URL{
|
||||||
Scheme: e.URL.Scheme,
|
Scheme: u.Scheme,
|
||||||
Host: e.URL.Host,
|
Host: u.Host,
|
||||||
Path: routePath.Path,
|
Path: routePath.Path,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user