#!/usr/bin/env bash # registry-rm-repo # description: remove repository directory from registry data directory set -eu REPO_DIR="/mnt/registry_data/data/docker/registry/v2/repositories/" REPO_TO_DELETE="$1" if [ -d "${REPO_DIR}/${REPO_TO_DELETE}" ]; then sudo rm -rf "${REPO_DIR}/${REPO_TO_DELETE}" echo "${REPO_TO_DELETE} repo successfully deleted" exit 0 else echo "${REPO_TO_DELETE} repo not found" exit 1 fi