Closed kasrahabib closed 1 month ago
Similar problem here using the simplechat UI from the examples.
Dockerfile:
FROM ghcr.io/ggerganov/llama.cpp:server
COPY llama.cpp /home/llama.cpp
COPY simplechat-ui /app/simplechat-ui
RUN apt-get update && apt-get install -y gcc g++ make cmake libssl-dev libuv1-dev libmicrohttpd-dev build-essential ccache
WORKDIR /home/llama.cpp
RUN make
CMD ["./llama-server", "-p", "8080:8080", "-m", "/home/llama.cpp/models/model_name.gguf", "--path", "/home/simeplchat-ui", "--port", "8080", "--host", "127.0.0.1"]
Successful build (note that I added op's suggestion in the CMD, but it didn't fix it for me).
Run:
docker run ./llama-server -m /home/llama.cpp/models/model_name.gguf --path /home/simplechat-ui --host 127.0.0.1 --port 8080
Image and container are generated, logs indicate a successful run, but when navigating to 127.0.0.1:8080, there is a connection error.
Inference works fine when running without Docker. So there seems to be an issue with the port. I also tried adding ENV
to my Dockerfile to bind the port and host but it was also unsuccessful.
I am on Macbook Pro M1 Pro Sonoma 14.4.1
This issue was closed because it has been inactive for 14 days since being marked as stale.
What happened?
Missing Port Binding in Docker Run Command
Description:
Hello,
I encountered an issue with the Docker run command provided in the docker.md file for the repository. The command as currently written causes a connection error due to the missing port binding between the Docker container and the host machine.
The command provided in the documentation:
Running this command and sending a message using Huggingface Chat UI results in the following error:
Proposed Fix:
To resolve this issue, the port binding should be added to the Docker run command. Below is the corrected command that works successfully:
The key addition is the
-p 8080:8080
flag to bind port 8080 on the container to port 8080 on the host machine.Request:
Please update the documentation to include the port binding in the Docker run command to help others avoid this error.
Thank you for your attention to this matter!
Name and Version
-
What operating system are you seeing the problem on?
Linux
Relevant log output