Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
cc650919
Commit
cc650919
authored
Nov 17, 2017
by
David Johnson
Browse files
Handle registry auth failures better in create-docker-image .
parent
a0cb56f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/linux/docker/create-docker-image
View file @
cc650919
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment