#!/usr/bin/env bash # Tear the dockerized fleet down: containers, network, per-container cgroup dirs, generated # state. Leaves the images and the cached release tarball (/var/tmp/sb-fleet/dist) alone. set -euo pipefail # shellcheck source=fleet_common.sh . "$(dirname "${BASH_SOURCE[0]}")/fleet_common.sh" for c in "${FLEET_ALL[@]}"; do docker rm -f "$c" >/dev/null 2>&1 || true done docker network rm "$FLEET_NET" >/dev/null 2>&1 || true for c in "${FLEET_ALL[@]}"; do d=$CG_ROOT/$c if [ -d "$d" ]; then # cgroup dirs are removed leaf-first with rmdir (they have no files to delete) find "$d" -depth -type d -exec rmdir {} + 2>/dev/null || true fi done find "$FLEET_GEN" -mindepth 1 -delete 2>/dev/null || true echo "fleet down (images and $FLEET_DIR/dist kept)"