Files
dropshell-templates/docker-registry/uninstall.sh
j c1e521a3b4
Some checks failed
Test and Publish Templates / test-and-publish (push) Failing after 5s
add docker-registry
2026-01-14 10:29:13 +13:00

18 lines
690 B
Bash
Executable File

#!/bin/bash
source "${AGENT_PATH}/common.sh"
_check_required_env_vars
# UNINSTALL SCRIPT
# The uninstall script is required for all templates.
# It is used to uninstall the service from the server.
_remove_container "$CONTAINER_NAME" || _die "Failed to remove container ${CONTAINER_NAME}"
_is_container_running "$CONTAINER_NAME" && _die "Couldn't stop existing container"
_is_container_exists "$CONTAINER_NAME" && _die "Couldn't remove existing container"
# remove the image
docker rmi "$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG" || echo "Failed to remove image $IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG"
echo "Uninstallation of ${CONTAINER_NAME} complete."
echo "Local data still in place."