Closed lbielicki closed 9 months ago
@lbielicki I'm also running into the same issue. In the terminal window where you initialized the Docker container with docker run
, what does the following line return for you?
docker logs 'CONTAINER ID'
This is the output on my end when I run that line:
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 125-442-018
I'm thinking that the issue might be related to the Running on http://0.0.0.0:5000/
line. From what I understand, this means that the Flask application inside the container is running on port 5000. However, in my docker run
command, I think that I specified a different mapping for the container port when I specified:
docker run -d -p host_port:container_port flask-tutorial
Essentially, I think the issue is that the container_port
in the docker run
command that I specify does not align with the container that the Flask app is running on, indicated by the output of the docker logs
command.
Any input would be appreciated!
@oliver-ricken I was able to resolve this error, but not sure what directly caused it/why the error was coming up, so I'll summarize what I did:
I used python3 app.py
to test my file, and figured out I still needed to fix some small errors such as changing the F in From to lowercase
I had to run pip install flask
in the terminal
I logged in using -L localhost:8899:localhost:8899
at the end of my usual login, and similarly only used docker run -d -p 8899:8899 flask-tutorial
when it came time to connect
edit: btw I did not get the same message when I ran docker logs 'CONTAINER ID'
, I think I had a separate problem with the container
Hello all,
It looks like my Dockerfile is building correctly, but I'm running into an issue with port forwarding. I've tried a couple of things but most recently:
log in with
ssh Liann.Bielicki.24@lambda.compute.cmc.edu -p 5055 -L localhost:8899:localhost:5055
and runwhich gives me the error described in the title. when I refresh in the browser (localhost:8899) the error message repeats and grows longer. has anyone else run into this? any advice on how to format the port forwarding (or point me elsewhere) is appreciated!