2

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.

Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
  • 2
    Possible duplicate of [Docker Networking Disabled: WARNING: IPv4 forwarding is disabled. Networking will not work](https://stackoverflow.com/questions/41453263/docker-networking-disabled-warning-ipv4-forwarding-is-disabled-networking-wil) – Sraw Mar 26 '18 at 06:03
  • Why not have a search first? – Sraw Mar 26 '18 at 06:04

2 Answers2

2

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

Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
-1

Another solution is..

Try adding -net=host along with docker run command

https://medium.com/@gchandra/docker-ipv4-forwarding-is-disabled-8499ce59231e

Ganesh Chandrasekaran
  • 1,578
  • 12
  • 17