diff --git a/src/main/resources/com/rultor/agents/req/_head.sh b/src/main/resources/com/rultor/agents/req/_head.sh index a55645ccf9..da66e854e4 100644 --- a/src/main/resources/com/rultor/agents/req/_head.sh +++ b/src/main/resources/com/rultor/agents/req/_head.sh @@ -84,11 +84,13 @@ function docker_when_possible { use_image="${image}" docker pull "${use_image}" fi - docker run --rm -v "$(pwd):/main" "${vars[@]}" \ + if docker run --rm -v "$(pwd):/main" "${vars[@]}" \ --memory=4g "--cidfile=$(pwd)/cid" -w=/main \ - --name="${talk}" "${image}" /main/entry.sh - if [ -n "${directory}" ]; then - docker rmi "${use_image}" + --name="${talk}" "${image}" /main/entry.sh \ + || true; then + if [ -n "${directory}" ]; then + docker rmi "${use_image}" + fi fi sudo chown -R $(whoami) repo cd repo