diff options
author | Joffrey F <joffrey@docker.com> | 2017-08-15 15:38:09 -0700 |
---|---|---|
committer | Joffrey F <f.joffrey@gmail.com> | 2017-08-15 15:59:33 -0700 |
commit | e9fab1432b974ceaa888b371e382dfcf2f6556e4 (patch) | |
tree | 162ecffd845f25da28e1f42c3f5d65c4f0113352 | |
parent | 35f29d08d748fbf78b08c18a1cd3cad92944d022 (diff) | |
download | docker-py-e9fab1432b974ceaa888b371e382dfcf2f6556e4.tar.gz |
Daemon expects full URL of hub in auth config dict in build payload
Signed-off-by: Joffrey F <joffrey@docker.com>
-rw-r--r-- | docker/api/build.py | 5 | ||||
-rw-r--r-- | docker/auth.py | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/docker/api/build.py b/docker/api/build.py index cbef4a8..5d4e772 100644 --- a/docker/api/build.py +++ b/docker/api/build.py @@ -274,7 +274,10 @@ class BuildApiMixin(object): self._auth_configs, registry ) else: - auth_data = self._auth_configs + auth_data = self._auth_configs.copy() + # See https://github.com/docker/docker-py/issues/1683 + if auth.INDEX_NAME in auth_data: + auth_data[auth.INDEX_URL] = auth_data[auth.INDEX_NAME] log.debug( 'Sending auth config ({0})'.format( diff --git a/docker/auth.py b/docker/auth.py index ec9c45b..c3fb062 100644 --- a/docker/auth.py +++ b/docker/auth.py @@ -10,7 +10,7 @@ from . import errors from .constants import IS_WINDOWS_PLATFORM INDEX_NAME = 'docker.io' -INDEX_URL = 'https://{0}/v1/'.format(INDEX_NAME) +INDEX_URL = 'https://index.{0}/v1/'.format(INDEX_NAME) DOCKER_CONFIG_FILENAME = os.path.join('.docker', 'config.json') LEGACY_DOCKER_CONFIG_FILENAME = '.dockercfg' TOKEN_USERNAME = '<token>' @@ -118,7 +118,7 @@ def _resolve_authconfig_credstore(authconfig, registry, credstore_name): if not registry or registry == INDEX_NAME: # The ecosystem is a little schizophrenic with index.docker.io VS # docker.io - in that case, it seems the full URL is necessary. - registry = 'https://index.docker.io/v1/' + registry = INDEX_URL log.debug("Looking for auth entry for {0}".format(repr(registry))) store = dockerpycreds.Store(credstore_name) try: |