From f126bcc60e797084f9d5209961f82f92b545a86c Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 18 Sep 2018 17:28:56 +0800 Subject: [PATCH] `./launhcer run` should exit with the right code. --- launcher | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/launcher b/launcher index 5b5d5dc..fb6bbd7 100755 --- a/launcher +++ b/launcher @@ -592,8 +592,13 @@ setup_bootstrap() { run_run() { setup_bootstrap - $docker_path run --rm --shm-size=512m $user_args $links "${env[@]}" -e DOCKER_HOST_IP="$docker_ip" -i -a stdin -a stdout -a stderr $volumes $image \ - /bin/bash -c "$run_command" + unset ERR + (exec $docker_path run --rm --shm-size=512m $user_args $links "${env[@]}" -e DOCKER_HOST_IP="$docker_ip" -i -a stdin -a stdout -a stderr $volumes $image \ + /bin/bash -c "$run_command") || ERR=$? + + if [[ $ERR > 0 ]]; then + exit 1 + fi } run_bootstrap() { -- 2.25.1