How to get IP address of a docker swarm node?

Solution 1:

ubuntu@ubuntu-xenial:~$ docker node inspect -h
Flag shorthand -h has been deprecated, please use --help

Usage:  docker node inspect [OPTIONS] self|NODE [NODE...]

Display detailed information on one or more nodes

Options:
  -f, --format string   Format the output using the given Go template
      --help            Print usage
      --pretty          Print the information in a human friendly format

and

ubuntu@ubuntu-xenial:~$ docker node inspect self --format '{{ .Status.Addr  }}'

returns the IP address.