[GH-ISSUE #7354] CMD ["serve"] is wrong in Dockerfile? #4674

Closed
opened 2026-04-12 15:35:40 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @YinYongHongYork on GitHub (Oct 25, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7354

What is the issue?

CMD ["serve"]

OS

Docker

GPU

Other

CPU

No response

Ollama version

No response

Originally created by @YinYongHongYork on GitHub (Oct 25, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7354 ### What is the issue? CMD ["serve"] ### OS Docker ### GPU Other ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the dockerquestion labels 2026-04-12 15:35:40 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 25, 2024):

ENTRYPOINT ["/bin/ollama"]
CMD ["serve"]

ENTRYPOINT is the command to run, CMD is the argument to that command. You can run the container with other arguments replacing CMD:

$ docker run --rm ollama/ollama:0.3.13 help ps
List running models

Usage:
  ollama ps [flags]

Flags:
  -h, --help   help for ps

Environment Variables:
      OLLAMA_HOST                IP Address for the ollama server (default 127.0.0.1:11434)
<!-- gh-comment-id:2437634099 --> @rick-github commented on GitHub (Oct 25, 2024): ```dockerfile ENTRYPOINT ["/bin/ollama"] CMD ["serve"] ``` `ENTRYPOINT` is the command to run, `CMD` is the argument to that command. You can run the container with other arguments replacing `CMD`: ```console $ docker run --rm ollama/ollama:0.3.13 help ps List running models Usage: ollama ps [flags] Flags: -h, --help help for ps Environment Variables: OLLAMA_HOST IP Address for the ollama server (default 127.0.0.1:11434) ```
Author
Owner

@dhiltgen commented on GitHub (Oct 29, 2024):

As Rick points out, this is by design to allow easy usage of the image as a client, while still defaulting to run a server if no command is specified.

<!-- gh-comment-id:2444946412 --> @dhiltgen commented on GitHub (Oct 29, 2024): As Rick points out, this is by design to allow easy usage of the image as a client, while still defaulting to run a server if no command is specified.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4674