How to get container ip address inside this container?
'docker inspect $hostname ...' not suitable, because I don't share /var/run/docker.sock host file to container.
How to get container ip address inside this container?
'docker inspect $hostname ...' not suitable, because I don't share /var/run/docker.sock host file to container.
Normally you can use the linux program
ifconfig
to get IP addresses and other networking details. Your container may not have it, in which case you'll need to install it viaapt-get
oryum
or your distro's package manager. A basic pipeline to get the IP address would be