I am trying to build the hello word docker image. But I am not able to get any response from POSTMAN GET request. Could you pls help to resolve?
Steps Tried:
- My hello word program:
2.My docker file:
4.Building image:
6.Checking docker machine ip:
- Create and run the container with docker machine ip
- Checking logs:
- Query with post man both local host and docker machine ip. ( No response)
Note: Tried with all options text,JSON,HTML
After that I have deleted the container & Tried to create and run with local host ip as below. Still no response from POSTMAN ( docker machine ip & local host ip)
As Ewong suggested & other form suggested I have modified the code as below.
FROM python
WORKDIR /program
COPY requirements.txt .
RUN pip3 install -r requirements.txt
copy src/ .
EXPOSE 5000
CMD [ "python","./app.py","--host", "0.0.0.0" ]
from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Hello world"
if __name__ == "__main__":
app.run()
But when i give curl command failed: