Skip to content

Instantly share code, notes, and snippets.

@olymk2
Last active May 17, 2017 14:48
Show Gist options
  • Save olymk2/fac0e449bc6fb8356846e54deda8f486 to your computer and use it in GitHub Desktop.
Save olymk2/fac0e449bc6fb8356846e54deda8f486 to your computer and use it in GitHub Desktop.
Docker Argos
#!/usr/bin/env bash
echo "Docker"
echo "---"
# http://stackoverflow.com/a/14853319
TOP_OUTPUT=$(docker ps -q | xargs docker inspect --format="http://{{if ne \"\" .NetworkSettings.IPAddress}}{{ printf \"%.22s\" .NetworkSettings.IPAddress}}{{else}}{{range .NetworkSettings.Networks}}{{printf \"%.22s\" .IPAddress}}{{end}}{{end}} {{printf \"%.30s\" .Name}} | href=\"http://{{if ne \"\" .NetworkSettings.IPAddress}}{{ printf \"%.22s\" .NetworkSettings.IPAddress}}{{else}}{{range .NetworkSettings.Networks}}{{printf \"%.22s\" .IPAddress}}{{end}}{{end}}\"" | column -t -s@ -c 80)
echo "$TOP_OUTPUT | font=monospace bash=top useMarkup=true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment