Docker inspect can be used to get information including IP address about a container using its id or name.
$ docker inspect [container_name_or_id]
To get only IP address
$ docker inspect --format '{{.NetworkSettings.IPAddress}}' nginx1 172.17.0.2
Docker inspect can be used to get information including IP address about a container using its id or name.
$ docker inspect [container_name_or_id]
To get only IP address
$ docker inspect --format '{{.NetworkSettings.IPAddress}}' nginx1 172.17.0.2