Search code examples
pythondockernetwork-programmingportforwardingipv4

ipv4 networking not enabled when runnig docker


I have a remote machine at my workplace, when we developers run server/ or docker containers. everything was working fine but a while back somethign went wrong.

if I run the python flask app

from app import app
app.run(host='0.0.0.0', port=5050)

i get message

* Running on http://0.0.0.0:5050/

and I am able to access the above from my local machine using the remote server machine ip:5050 but if I run docker container docker run -itd <conta_image_name> -p 80:90 --add-host=localdomain.com:machine_ip_address i get error message saying IPv4 forwarding is disabled. Networking will not work.

Now this issue is in production so I really need someone to throw up some light, what might be wrong or let me know what more info I need to put.


Solution

  • I have fixed this issue myself following this: https://success.docker.com/article/ipv4-forwarding