Skip to content

Instantly share code, notes, and snippets.

@bpholt
Created November 4, 2015 16:10
Show Gist options
  • Save bpholt/07752883f30cc4595d8d to your computer and use it in GitHub Desktop.
Save bpholt/07752883f30cc4595d8d to your computer and use it in GitHub Desktop.
Consul Registrator service name environment variables of all running Docker containers
docker inspect $(docker ps -q) | \
jq 'map(.Config.Env |
map(select((. | startswith("SERVICE")) and
(. | startswith("SERVICE_IGNORE") | not)))) |
reduce .[] as $item ([]; . + $item)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment