I am struggling for 3 days now and gone through all over the internet but not able to find an workable soultion. I am using docker on windows 10 home edition with virtual box. I have written a sample flask api :
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class HelloWorld(Resource):
def get(self):
return {'hello':'world'}
api.add_resource(HelloWorld,'/')
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
I am able to create an image and run it successfully on windows 10 using the docker machine ip
$ docker run -it -p 0.0.0.0:5000:5000 flask_docker
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 218-782-187
192.168.99.1 - - [04/Apr/2020 07:54:46] "GET / HTTP/1.1" 200 -
Now i am able to get a response accessing it from the same laptop/machine using :
where 192.168.99.100 is the docker-machine ip.
Now my ISSUE is if i try to access from another machine/phone which is using the same WIFI using :
http://192.168.99.100:5000/
It is giving me an error of NOT CONNECTION REFUSED that other users have but connection timeout/192.168.99.100 took too long to respond/This site can't be reached. Please help, what i am missing here.