clean.sh (622B)
1 #!/usr/bin/env bash 2 # Removes what the VM scripts made: stops the VM and deletes out/ (disks, key, 3 # logs, and podman's storage, whose files belong to root, so they're deleted 4 # from a container). With --all, also the built images (the registry's copy stays). 5 source "$(dirname "$0")/common.sh" 6 7 "$ROOT/vm/vm.sh" stop 8 if [[ -d "$OUT/containers" ]]; then 9 docker run --rm -v "$OUT:/out" docker.io/library/ubuntu:26.04 rm -rf /out/containers 10 fi 11 rm -rf "$OUT" 12 say "removed out/" 13 14 if [[ "${1:-}" == --all ]]; then 15 docker image rm "$IMAGE" "$SYSTEM_IMAGE" >/dev/null 2>&1 || true 16 say "removed $IMAGE and $SYSTEM_IMAGE" 17 fi