diff --git a/Dockerfile b/Dockerfile index 13ebd1f..ddace06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,7 +102,7 @@ RUN \ sleep 1; \ done; \ # Kill installer after timeout indicated by `maxCount` - [ "$x" -eq "$maxCount" ] && { pkill -9 "$installerName"; mv "$logFile" "$logDir/timeout-try$try.log"; }; \ + [ "$x" -eq "$maxCount" ] && { kill_installer; mv "$logFile" "$logDir/timeout-try$try.log"; }; \ } & \ }; \ wait "$pid"; \ @@ -144,12 +144,15 @@ RUN \ -e ":end q;"; \ exitCode="$?"; \ # Kill installer if it got stuck (according to console output) - [ "$exitCode" -eq 42 ] && pkill -9 "$installerName"; \ + [ "$exitCode" -eq 42 ] && kill_installer; \ # Use `sed`s exit code if non-zero [ "$exitCode" -ne 0 ] && exit "$exitCode" || \ # Return true otherwise true; \ }; \ + kill_installer() { \ + pkill -9 "$installerName" > /dev/null 2>&1; \ + }; \ display=:90; \ export DISPLAY="$display"; \ mkdir -p --mode=777 /tmp/.X11-unix; \