Skip to content

Instantly share code, notes, and snippets.

@mrsarm
Created October 17, 2022 12:32
Show Gist options
  • Save mrsarm/f1b794858cf29ca47f36a2093b5f8be6 to your computer and use it in GitHub Desktop.
Save mrsarm/f1b794858cf29ca47f36a2093b5f8be6 to your computer and use it in GitHub Desktop.
docker-compose-services: list all services found in the docker-compose.yml file
#!/usr/bin/env bash
if [ "$1" == "-h" -o "$1" == "--help" ]; then
echo 'docker-compose-services: list all services found in the docker-compose.yml file'
exit
fi
cat docker-compose.y*ml | grep -oP '(?<=^ )(\w|-)+(?=:)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment