Skip to content

Instantly share code, notes, and snippets.

@rjchicago
Created October 26, 2022 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjchicago/ef78d25de0089b6c9edd719906e33dcc to your computer and use it in GitHub Desktop.
Save rjchicago/ef78d25de0089b6c9edd719906e33dcc to your computer and use it in GitHub Desktop.
Docker Swarm Host IPs
# get hosts (mgr node)
HOSTS=$(docker node ls --format "{{.Hostname}}")
# print host/ip
for HOST in $HOSTS; do host $HOST; done | awk '{print $1, $4}' | sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment