Commit cc650919 authored by David Johnson's avatar David Johnson

Handle registry auth failures better in create-docker-image .

parent a0cb56f6
......@@ -134,20 +134,26 @@ if ($debug) {
# First, try to login to the registry with user/pass.
#
my $i = 10;
my $code;
while ($i > 0) {
if ($usecli) {
system("docker login -p '$pass' -u '$user' $registry");
$code = $?;
}
else {
my ($code) = $client->registry_auth($registry,$user,$pass);
$? = $code;
($code,) = $client->registry_auth($registry,$user,$pass);
}
last
if ($? == 0);
print STDERR "ERROR: failed to login to registry $registry; sleeping and trying again...\n";
if ($code == 0);
print STDERR "ERROR: failed to login to registry $registry ($code);".
" sleeping and trying again...\n";
sleep(4);
$i -= 1;
}
if ($code) {
print STDERR "ERROR: failed to login to registry $registry; aborting!\n";
exit(-2);
}
#
# Check container status. If it is running, we need to stop it. We
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment