I required a quick test to validate what containers were connected to my custom bridge to troubleshoot a connectivity issue between containers. The below test can answer both the 1st & 3rd parts of the OP's question:
docker network inspect <tab complete to show avail. bridges> | grep IPv4Address
Specimen Output:
docker network inspect <tab completion results below>
bridge docker-compose_zabbix_zbx_net_backend host
docker-compose_zabbix_default docker-compose_zabbix_zbx_net_frontend none
ubuntu@myDockerHost:~$ docker network inspect docker-compose_zabbix_zbx_net_backend | grep IPv4Address
"IPv4Address": "172.16.239.6/24",
"IPv4Address": "172.16.239.7/24",
"IPv4Address": "172.16.239.4/24",
"IPv4Address": "172.16.239.5/24",
"IPv4Address": "172.16.239.8/24",
"IPv4Address": "172.16.239.3/24",
"IPv4Address": "172.16.239.2/24",
or by containerName:
docker network inspect <tab complete to show avail. bridges> | grep Name
Specimen Output:
docker network inspect docker-compose_zabbix_zbx_net_backend | grep Name
"Name": "docker-compose_zabbix_zbx_net_backend",
"Name": "docker-compose_zabbix-zabbix-agent",
"Name": "docker-compose_zabbix-zabbix-server",
"Name": "docker-compose_zabbix-zabbix-web-service",
"Name": "docker-compose_zabbix-postgres-server",
"Name": "docker-compose_zabbix-zabbix-web-nginx-pgsql",
"Name": "docker-compose_zabbix-zabbix-java-gateway",
"Name": "docker-compose_zabbix-zabbix-snmptraps",
The results will reveal all the containers joined to the specified bridge by either IP or Name.
NOTE: Do not supply the random bridge names assigned to bridges in the output of ip addr list
for the value of the bridge name in the above commands. If you do, the error Error: No such network: br-abtfta2nb624
will be puked.
As for the 2nd part of the OP's question, I refer the reader to @johnharris85 's excellent answer.