-2

I have a Docker container that has a bridge network driver with IP 172.17.0.2.

Inside the container, I'm running a Python application that needs to communicate with an external service that has an IP address like 172.17.xxx.xx

When the Python application inside the container tries to connect to 172.17.xxx.xx, it throws an error, because default IP route in the container

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • What or where is the external service? You can change either IP address? – Daniel W. Nov 13 '22 at 17:02
  • When you `docker network create` the network, you need to specify a CIDR range that doesn't conflict with the host's network environment (pretty much only in this specific situation). The linked question has an extensive explanation of the process. – David Maze Nov 13 '22 at 22:12

1 Answers1

0

172.17.xxx.xx is part of a private IP range as set out in RFC 1918. It should never be used for something that needs to be accessed from outside the private network.

Hans Kilian
  • 18,948
  • 1
  • 26
  • 35