[GH-ISSUE #11666] Support pull without a running server #69773

Open
opened 2026-05-04 19:08:59 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @ag-TJNII on GitHub (Aug 5, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11666

There are Docker use cases where it's desirable to "bake" the model into a custom Docker image. For example, if a Ollama server container is intended to run with restricted network access for data controls, it is useful to already have the model cached and ready.

There is a convenient pull command for this, but it requires a running server:

$ docker run --rm -ti ollama/ollama pull llama3:8b
Error: ollama server not responding - could not connect to ollama server, run 'ollama serve' to start it

The workaround from https://github.com/ollama/ollama/issues/9888#issuecomment-2736224280 is functional, but not ideal. Take the following Dockerfile:

FROM ollama/ollama

RUN ollama serve & server=$! ; \
    sleep 2 ; \
    ollama pull llama3:8b ; \
    kill $server

This:

  • Starts the server as a background process
  • Sleeps two seconds for the server to start
  • Pulls the model
  • Manually kills the server

Rather than starting two processes in the RUN step, and needing to manage the background process, it would be nice if ollama pull didn't rely on a background server running. This would make pre-caching models easier.

Thank you for considering this feature.

Originally created by @ag-TJNII on GitHub (Aug 5, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11666 There are Docker use cases where it's desirable to "bake" the model into a custom Docker image. For example, if a Ollama server container is intended to run with restricted network access for data controls, it is useful to already have the model cached and ready. There is a convenient `pull` command for this, but it requires a running server: ```bash $ docker run --rm -ti ollama/ollama pull llama3:8b Error: ollama server not responding - could not connect to ollama server, run 'ollama serve' to start it ``` The workaround from https://github.com/ollama/ollama/issues/9888#issuecomment-2736224280 is functional, but not ideal. Take the following Dockerfile: ```Dockerfile FROM ollama/ollama RUN ollama serve & server=$! ; \ sleep 2 ; \ ollama pull llama3:8b ; \ kill $server ``` This: - Starts the server as a background process - Sleeps two seconds for the server to start - Pulls the model - Manually kills the server Rather than starting two processes in the `RUN` step, and needing to manage the background process, it would be nice if `ollama pull` didn't rely on a background server running. This would make pre-caching models easier. Thank you for considering this feature.
GiteaMirror added the feature request label 2026-05-04 19:08:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#69773