Skip to content

Commit 938324b

Browse files
authored
Merge pull request #1334 from MridulS/patch-1
Update DOCKER_REGISTRY_URL to the recommended one
2 parents 1957bfb + f1c563c commit 938324b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

binderhub/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from traitlets.config import LoggingConfigurable
1212
from traitlets import Dict, Unicode, default
1313

14-
DEFAULT_DOCKER_REGISTRY_URL = "https://registry.hub.docker.com"
14+
DEFAULT_DOCKER_REGISTRY_URL = "https://registry-1.docker.io"
1515
DEFAULT_DOCKER_AUTH_URL = "https://index.docker.io/v1"
1616

1717

@@ -128,7 +128,7 @@ def _default_token_url(self):
128128
url = urlparse(self.url)
129129
if ("." + url.hostname).endswith(".gcr.io"):
130130
return "https://{0}/v2/token?service={0}".format(url.hostname)
131-
elif self.url.endswith(".docker.com"):
131+
elif self.url.endswith(".docker.io"):
132132
return "https://auth.docker.io/token?service=registry.docker.io"
133133
else:
134134
# is gcr.io's token url common? If so, it might be worth defaulting

binderhub/tests/test_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
def test_registry_defaults(tmpdir):
1414
registry = DockerRegistry(docker_config_path=str(tmpdir.join("doesntexist.json")))
15-
assert registry.url == "https://registry.hub.docker.com"
15+
assert registry.url == "https://registry-1.docker.io"
1616
assert registry.auth_config_url == "https://index.docker.io/v1"
1717
assert (
1818
registry.token_url == "https://auth.docker.io/token?service=registry.docker.io"
@@ -37,7 +37,7 @@ def test_registry_username_password(tmpdir):
3737
registry = DockerRegistry(docker_config_path=str(config_json))
3838
assert registry.username == "user"
3939
assert registry.password == "pass"
40-
assert registry.url == "https://registry.hub.docker.com"
40+
assert registry.url == "https://registry-1.docker.io"
4141

4242

4343
def test_registry_gcr_defaults(tmpdir):

doc/zero-to-binderhub/setup-binderhub.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ If you setup your own local registry using
281281
url: "https://index.docker.io/v1"
282282
config:
283283
DockerRegistry:
284-
url: "https://registry.hub.docker.com" # the actual v2 registry url
284+
url: "https://registry-1.docker.io" # the recommended registry URL
285285
auth_config_url: "https://index.docker.io/v1" # must match above!
286286
token_url: "https://auth.docker.io/token?service=registry.docker.io"
287287

0 commit comments

Comments
 (0)