Docker Community Forums

Share and learn in the Docker community.

Ip Address from docker inspect --format='{{.NetworkSettings.Networks.nat.IPAddress}}' <container id> often wrong after 18.09.1 update


#1

Hi,

I’m am using docker for windows desktop to build and run docker containers locally for testing. Prior to upgrading 18.09.1 I could run docker inspect --format=’{{.NetworkSettings.Networks.nat.IPAddress}}’ to get the ip address and be confident that when I called that IP the container would be hit. Recently though, (after the upgrade) I’ve been finding that the ip address returned often doesn’t match the one I need to hit the container, and instead the only way to get the correct ip address is docker exec -t ipconfig. (Oddly enough though it did work for one container once.) Has anyone else hit this?

I’m getting the containers running by

  1. docker-compose build - > using an ACR registry defined in the docker-compose.yml
  2. docker create
  3. docker start <container id from 2>.

Thank you!