Clean script: remove only the stack volumes and ask for confirmation

Closes #243 (closed)

Description

clean_capif_docker_services.sh ended with docker volume prune --all --force, which deletes every unused Docker volume on the host, not only OpenCAPIF's. It now runs docker compose down -v for each selected stack, so only the volumes attached to those stacks' containers are removed, and the host-wide prune is gone.

New option -y (and --yes) skips the confirmation. Without it, the script lists the stacks and asks Continue? [y/N], but only when run in an interactive terminal; without a terminal (CI, cron) it behaves as before.

Checked

  • bash -n syntax check.
  • Run with a stub docker command (nothing real executed): -c -y, --yes -a, no terminal, and the prompt answered n (aborts, nothing removed).
  • On a v5 deployment, the 7 anonymous volumes belong to the mongo, mongo_register, redis and vault containers. A real docker compose down -v on a sample project removed only its own volume.

Known limitation

Anonymous volumes whose containers were already removed are no longer deleted (the old prune removed them). They can be removed manually with docker volume prune.

Merge request reports

Loading
Loading