summaryrefslogtreecommitdiff
path: root/start-container-docker.sh
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2019-06-12 21:47:24 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2019-06-12 21:47:24 +0000
commit007fc5541e8baa9d06abf5420ba272af0c750e2f (patch)
tree8cd78cc05ab0dcf3bb6d9ee91f852b4682a22ba0 /start-container-docker.sh
parent91aa3917a1c11415cc2703bb20e9c22b87a08e48 (diff)
start-container-docker.sh: Try to continue if docker run returns an error
In some cases, docker run returns a session_id, but it seems it returns an error code (or maybe ssh does). Try to continue if a session_id was generated, and print some information to help debug. Change-Id: I8eaa81cafe8b8dc3da5bbedf6537a97537d3c7a3
Diffstat (limited to 'start-container-docker.sh')
-rwxr-xr-xstart-container-docker.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/start-container-docker.sh b/start-container-docker.sh
index dfcff4ee..2f10e5df 100755
--- a/start-container-docker.sh
+++ b/start-container-docker.sh
@@ -254,9 +254,18 @@ docker_run=($DOCKER run --name $session_name -dtP \
${docker_opts} \
$image)
echo "${docker_run[@]}"
-session_id=$("${docker_run[@]}")
+
+# FIXME: It seems in some cases $DOCKER run generates a session_id but
+# returns an error code. Try to get more information
+ret=0
+session_id=$("${docker_run[@]}") || ret=$?
+
+if [ $ret -ne 0 ]; then
+ echo "WARNING: docker run returned an error: $ret, trying to continue nonetheless..."
+fi
if [ x"$session_id" = x ]; then
+ echo "ERROR: could not create session_id"
exit 1
fi