-2

I'm trying to connect connect my postgre DB (in a container) using pgadmin (in a different container).

I tried using the inspect command but the IPAddress is just an empty string:

$ podman inspect serene_lovelace | grep -i ipaddress

returns

            "IPAddress": "",

Edit:

Turns out the IP I needed is just the WSL2 intance's IP, here's how I obtain it:

ip addr | grep 172

returns

    inet 172.26.240.194/20 brd 172.26.255.255 scope global eth0

2 Answers2

1

If you want to get the ip address, use inspect -f to extract it

podman container inspect -f '{{.NetworkSettings.IPAddress}}' serene_lovelace 
gujiwork
  • 65
  • 7
0

Looking to the podman inspect general output for a container. The exact answer may depend :

  1. It can be :
    podman container inspect -f '{{.NetworkSettings.IPAddress}}' <your_container> 
  1. Or if you have specific named in NetworkSettings, you will access to it using :
    podman container inspect -f '{{.NetworkSettings.<MyNetwork>.IPAddress}}' <your_container> 

where:

  • <your_container> the container whose IP we are looking for
  • <MyNetwork> the name of your custum podman network

Regards,

PS: I do not have permission to comment (for answering
Topaz Rindu Nabiyallah) so I added my answer normally (but point 2) may solved the 'empty string' bad result.