@@ -293,20 +293,28 @@ def _set_auth_headers(self, headers):
293
293
# Send the full auth configuration (if any exists), since the build
294
294
# could use any (or all) of the registries.
295
295
if self ._auth_configs :
296
+ auth_cfgs = self ._auth_configs
296
297
auth_data = {}
297
- if self . _auth_configs .get ('credsStore' ):
298
+ if auth_cfgs .get ('credsStore' ):
298
299
# Using a credentials store, we need to retrieve the
299
300
# credentials for each registry listed in the config.json file
300
301
# Matches CLI behavior: https://github.com/docker/docker/blob/
301
302
# 67b85f9d26f1b0b2b240f2d794748fac0f45243c/cliconfig/
302
303
# credentials/native_store.go#L68-L83
303
- for registry in self . _auth_configs .get ('auths' , {}).keys ():
304
+ for registry in auth_cfgs .get ('auths' , {}).keys ():
304
305
auth_data [registry ] = auth .resolve_authconfig (
305
- self . _auth_configs , registry ,
306
+ auth_cfgs , registry ,
306
307
credstore_env = self .credstore_env ,
307
308
)
308
309
else :
309
- auth_data = self ._auth_configs .get ('auths' , {}).copy ()
310
+ for registry in auth_cfgs .get ('credHelpers' , {}).keys ():
311
+ auth_data [registry ] = auth .resolve_authconfig (
312
+ auth_cfgs , registry ,
313
+ credstore_env = self .credstore_env
314
+ )
315
+ for registry , creds in auth_cfgs .get ('auths' , {}).items ():
316
+ if registry not in auth_data :
317
+ auth_data [registry ] = creds
310
318
# See https://github.com/docker/docker-py/issues/1683
311
319
if auth .INDEX_NAME in auth_data :
312
320
auth_data [auth .INDEX_URL ] = auth_data [auth .INDEX_NAME ]
0 commit comments