Find all docker-compose files that are being used
By listing containers and their respective docker-compose file:
for container in $(docker ps | sed -e '1d' | egrep -o '[a-zA-Z0-9_-]+$'); do echo; echo "$container is spun up by..."; docker container inspect "$container" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}'; done
By simply showing a list of used docker-compose files:
composefiles=$(for container in $(docker ps | sed -e '1d' | egrep -o '[a-zA-Z0-9_-]+$'); do docker container inspect "$container" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}'; done); echo "$composefiles" | sort | uniq