michaelconnor00
7/31/2017 - 9:39 PM

Docker inspect formatting

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)