Docker Image successfully downloaded but fail to run locally

Hello everyone, I have created and run successfully an app, which is here: KaggleX Learning Path Index Chatbot (Demo) - a Hugging Face Space by Entz

Now I am going to run it locally, because I want to share a docker file with others, e.g. on github. I clicked 3-dot button > Run with Docker > copied the code > run it in the Terminal of my M1 Mac.

The copied code is here:

docker run -it -p 7860:7860 --platform=linux/amd64 \
	-e OPENAI_API_KEY="YOUR_VALUE_HERE" \ streamlit run

Of course I replaced the value with my real OpenAI API key.

The files were downloaded successfully,

I tried all these URLs:
Network URL: http ://
External URL: http. ://

None of them work. I tried also localhost:7860
It doesn’t work too.

Does anyone have similar experience? How do I fix it? Thank you.

I think the problem is my computer is a Mac M1. Does anyone know how to solve it?

hi @Entz ,

The issue lies in the exposed port within your Docker command. Thank you for the bug report. Here is the correct method:

docker run -it -p 8501:8501 --platform=linux/amd64 \
        -e OPENAI_API_KEY="YOUR_VALUE_HERE" \ streamlit run

Then you can go to http://localhost:8501/

1 Like

it works like charm thank you @radames
But why the official instruction is wrong to start with?

Now I have successfully pulled the huggingface docker image, and run it locally, thank you for your port 8501 solution.

I then push this image to Docker Hub with these codes:
docker tag 5946b8e1f6d0 lorentzyeung/entz-llm-5:latest
docker push lorentzyeung/entz-llm-5:latest

After that I test it with these codes:
docker pull lorentzyeung/entz-llm-5:latest
docker images

Yes it is pulled successfully.

Finally i run it with this code:
docker run -it -p 8501:8501 --platform=linux/amd64 -e OPENAI_API_KEY="THEIR_OPENAI_API_KEY" lorentzyeung/entz-llm-5:latest

It throws me the same error again:

Would you please help?

bug, we’re going to fix the instructions! thanks for raising the issue

I’m sorry, I’m not sure if I can help you here. If you’re using the same image, it should works as before.

no problem @radames

Nevermind @radames , i don’t know why as well. I tried several times. I even cleaned all caches and repushed and repulled the image again and again, still it doesn’ t run. I don’t understand why. It is just the same image i pulled from Huggingface.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.