Get Swarm node IP address from a container using API?

How to get the Swarm node IP address of just created container, using remote API?

  • Why https is forced?
  • Centos 6.6, python 2.7.2 object has no attribute 'StringIO
  • How to setup PyCharm for Docker inside Vagrant?
  • How to use docker in windows 7
  • Discourse run on nginx got 403 forbidden
  • How to apply kernel tuning on docker container
  • sources: where daemon call libcontainer in createContainer
  • Run a complex series of commands in the same Docker container
  • Create a Docker Container using VirtualBox on Windows for Kubernetes
  • Running SystemTap inside an unprivileged docker container
  • Laradock (docker) keeps throwing http error 500
  • Unable to pull Docker hello-world
  • One Solution collect form web for “Get Swarm node IP address from a container using API?”

    All relevant container information can be found with docker inspect <your container>.

    The IP of the node your container is running on can be obtained with

    docker inspect --format "{{ .Node.IP }}" <your container>

    Note however, that this might not be the publicly reachable IP address (on an AWS EC2 instance for example, where this would be a private IP).

    To get the hostname and port your swarm masters use to reach the node, use

    docker inspect --format "{{ .Node.Addr }}" <your container>
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.