@@ -138,18 +138,6 @@ public Authorization call() throws IOException, NonexistentDockerCredentialHelpe
138138 return knownRegistryCredentials .getAuthorization ();
139139 }
140140
141- // Tries to get registry credentials from the Docker config.
142- try {
143- Authorization dockerConfigAuthorization = dockerConfigCredentialRetriever .retrieve ();
144- if (dockerConfigAuthorization != null ) {
145- buildLogger .info ("Using credentials from Docker config for " + registry );
146- return dockerConfigAuthorization ;
147- }
148-
149- } catch (IOException ex ) {
150- buildLogger .info ("Unable to parse Docker config" );
151- }
152-
153141 // Tries to infer common credential helpers for known registries.
154142 for (String registrySuffix : COMMON_CREDENTIAL_HELPERS .keySet ()) {
155143 if (registry .endsWith (registrySuffix )) {
@@ -173,6 +161,18 @@ public Authorization call() throws IOException, NonexistentDockerCredentialHelpe
173161 }
174162 }
175163
164+ // Tries to get registry credentials from the Docker config.
165+ try {
166+ Authorization dockerConfigAuthorization = dockerConfigCredentialRetriever .retrieve ();
167+ if (dockerConfigAuthorization != null ) {
168+ buildLogger .info ("Using credentials from Docker config for " + registry );
169+ return dockerConfigAuthorization ;
170+ }
171+
172+ } catch (IOException ex ) {
173+ buildLogger .info ("Unable to parse Docker config" );
174+ }
175+
176176 /*
177177 * If no credentials found, give an info (not warning because in most cases, the base image is
178178 * public and does not need extra credentials) and return null.
0 commit comments