diff --git a/common-functions b/common-functions index c5bd0bb..02470a5 100755 --- a/common-functions +++ b/common-functions @@ -279,9 +279,12 @@ service_container_rm() { local SERVICE_NAME="$(get_service_name "$SERVICE")" service_stop "$SERVICE" + local ID=$(docker inspect "$SERVICE_NAME" -f '{{ .ID }}' 2> /dev/null || true) + [[ -z "$ID" ]] && return 0 + dokku_log_verbose_quiet "Removing container" if ! docker rm "$SERVICE_NAME" > /dev/null 2>&1; then - dokku_log_fail "Unable to remove container for service $SERVICE" + dokku_log_fail "Unable to remove container for service $SERVICE" fi }