Skip to content

Instantly share code, notes, and snippets.

@michaelconnor00
Last active February 3, 2018 23:19
Show Gist options
  • Save michaelconnor00/bc674ed2046ebaadd67dab3cfaf8523b to your computer and use it in GitHub Desktop.
Save michaelconnor00/bc674ed2046ebaadd67dab3cfaf8523b to your computer and use it in GitHub Desktop.
Docker inspect formatting
docker service inspect \
-f='{{range $ports := .Endpoint.Ports}}Service ID: {{$.ID}}, Image: {{$.Spec.TaskTemplate.ContainerSpec.Image}}Ports: {{json $ports}}{{end}}' \
$(docker service ls -q)
# Less Verbose
docker service inspect -f='{{range $ports := .Endpoint.Ports}}{{json $ports}}{{end}}' $(docker service ls -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment