diff --git a/nextcloud/actions/upgrade b/nextcloud/actions/upgrade index 8d8902d..84133e9 100755 --- a/nextcloud/actions/upgrade +++ b/nextcloud/actions/upgrade @@ -152,6 +152,9 @@ if [ -n "$containers" ]; then err "Failed to stop container '$container'." exit 1 } + docker rm "$container" > /dev/null || { + err "Couldn't delete container '$container'." + } container_stopped+=("$container") done fi @@ -180,6 +183,7 @@ for image_version in "${upgrade_path[@]}"; do err "Unexpected step where config version ${WHITE}$current_config_version${NORMAL} is more than one major version less than image version ${WHITE}$image_version${NORMAL}" exit 1 fi + docker rmi "docker.0k.io/nextcloud:${current_config_version}-myc" >/dev/null 2>&1 || true if [ "$current_code_version" == "$image_version" ]; then ## Code already setup, we need to call ``occ upgrade`` by our selves info "Upgrading ${WHITE}$current_config_version${NORMAL} => ${WHITE}$image_version${NORMAL} (db)"