#!/bin/bash

dockerComposeDownAllApps() 
{
    local type="$1"
    # runFileOp: containers/ is owned by the container user (dockerinstall, 751)
    # under rootless and isn't list-readable by the manager — enumerate as the
    # owner or this silently finds nothing and no apps get brought down.
    local subdirectories=($(runFileOp find "$containers_dir" -mindepth 1 -maxdepth 1 -type d))

    for dir in "${subdirectories[@]}"; do
        local app_name=$(basename "$dir")
        dockerComposeDown "$app_name" "" "$type"
    done
}
