Created
December 29, 2023 22:56
-
-
Save horaciod/cf236264c0e42af157eb0f74e27e4a6c to your computer and use it in GitHub Desktop.
listar todos los contenedores con los nombres de proyectos de docker-compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## https://stackoverflow.com/questions/70915151/how-to-show-all-running-containers-created-by-docker-compose-globally-regardle | |
base='{{.Status}}\t{{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Ports}}\t{{.Networks}}\t{{.Mounts}}' | |
compose='{{.Label "com.docker.compose.project"}}\t{{.Label "com.docker.compose.service"}}' | |
docker container ls --all \ | |
--filter label=com.docker.compose.project \ | |
--format "table $compose\t$base" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment