diff --git a/ci/clean-build-package.sh b/ci/clean-build-package.sh index a36691cda..43988ccdb 100755 --- a/ci/clean-build-package.sh +++ b/ci/clean-build-package.sh @@ -3,6 +3,12 @@ set -ex # clean up docker stuff name=cfengine-build-package # TODO: a softer clean might get into the container and run ./buildscripts/build-scripts/clean-buildmachine -docker stop $name -docker rm -f $name -docker rmi -f $name +if docker ps | grep $name; then + docker stop $name +fi +if docker ps -a | grep $name; then + docker rm $name +fi +if docker images | grep $name; then + docker rmi -f $name +fi