Skip to content

Instantly share code, notes, and snippets.

@baydakovss
Last active June 17, 2023 14:31
Show Gist options
  • Save baydakovss/0944441b547233f9b641cc604c3a28d7 to your computer and use it in GitHub Desktop.
Save baydakovss/0944441b547233f9b641cc604c3a28d7 to your computer and use it in GitHub Desktop.
How to list docker swarm nodes with labels
docker node ls -q | xargs docker node inspect -f '{{ .ID }} [{{ .Description.Hostname }}]: {{ .Spec.Labels }}'
docker node inspect --pretty swarm
ID: xa56lddvm1la1i8f444zw4mop
Labels:
- env=prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment