From 3c50ab043f20f3a0dff3ae2b096ae77352f3bbb3 Mon Sep 17 00:00:00 2001 From: Aurelijus Banelis Date: Mon, 12 Nov 2018 23:08:31 +0200 Subject: [PATCH] Fix for not working scripts/install-prod.sh For fresh applications, docker may exit with 129 code instead of 0. Issue found on: Docker version 17.03.2-ce, build f5ec1e2 (linux). Related: https://github.com/docker/compose/issues/3379 --- scripts/backend.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/backend.sh b/scripts/backend.sh index 41c49a9c9..e3dd32762 100755 --- a/scripts/backend.sh +++ b/scripts/backend.sh @@ -16,9 +16,25 @@ fi if [ "$ARGS" != "" ]; then echo "Executing in PHP container: $ARGS" docker exec -it php.symfony bash -c "$ARGS" + + # Fix for known docker issue, when with "-it" parameter, command exits with status 129 + EXIT_CODE=$? + if [ $EXIT_CODE -eq 129 ]; then + exit 0 + else + exit $EXIT_CODE + fi else echo "Dependencies can be installed via: composer install" echo "Many Symfony tools can be accessed via: bin/console" echo 'Type "exit" to get out of terminal' docker exec -it php.symfony bash -fi \ No newline at end of file + + # Fix for known docker issue, when with "-it" parameter, command exits with status 129 + EXIT_CODE=$? + if [ $EXIT_CODE -eq 129 ]; then + exit 0 + else + exit $EXIT_CODE + fi +fi