Skip to content

Instantly share code, notes, and snippets.

@nothub
Created November 25, 2023 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nothub/29d377492de878978ed111b0d2f6ce2b to your computer and use it in GitHub Desktop.
Save nothub/29d377492de878978ed111b0d2f6ce2b to your computer and use it in GitHub Desktop.
render docker-compose layout
#!/usr/bin/env bash
IFS=$'\n' read -rd '' -a services <<<"$(find "/opt/services" -mindepth 1 -maxdepth 1 -type d -printf '%f\n')"
for service in "${services[@]}"; do
echo "rendering ${service}"
sudo docker run --rm -it \
-v "/opt/services/${service}:/input:ro" \
-v "${PWD}:/output" \
pmsipilot/docker-compose-viz render -f -m image -o "/output/${service}.png" -- "docker-compose.yaml"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment