Containers are designed to be isolated but sometimes they need to communicate with other containers. This can be necessary when you have a container as your database server and you have a management tool, e.g.L: PGAdmin, running in another container in order to query and manage the database. In order to achieve this you need the container’s IP in the network bridge created by Docker. Follow either one of these two methods to achieve this:

1. Using docker CLI

  1. List all the containers and choose the id of the one you need
docker container ls
  1. Find our the IP Address
docker inspect <CONTAINER_ID> | grep '"IPAddress"' | head -n 1

2. Using CTOP

CTOP is a great command-line tool for monitoring containers and gaining insights about them. Finding out a container’s ip is dead easy:

  1. Start ctop
ctop
  1. Access the single view of a container

Access single view of a container

  1. Find the container’s ip.

Find the ip of the container in its single view