[GH-ISSUE #7401] Configure docker image to start with some models installed #4707

Closed
opened 2026-04-12 15:38:59 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @fnacarellidev on GitHub (Oct 28, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7401

I think it would be very nice if we had an option to install some models on the build stage of the ollama docker image, right now I have 2 workarounds to emulate this behaviour:

  1. Have an init container that talks to the ollama container and installs the models, not very good because I can't cache that, so everytime I restart the kubernetes environment it has to reinstall each model, which might take long depending on the environment.

FROM ollama/ollama

RUN nohup bash -c "ollama serve &" && wait4x http http://127.0.0.1:11434 && ollama pull llava && ollama pull llama3

However the 2nd option is not working very well, when I install the models in that way every request take a lot of time to finish, and sometimes it doesn't finishes, it simply hangs, not sure if there's something wrong with the logic, I copied from the #957 issue.

Originally created by @fnacarellidev on GitHub (Oct 28, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7401 I think it would be very nice if we had an option to install some models on the build stage of the ollama docker image, right now I have 2 workarounds to emulate this behaviour: 1. Have an init container that talks to the ollama container and installs the models, not very good because I can't cache that, so everytime I restart the kubernetes environment it has to reinstall each model, which might take long depending on the environment. 2. ```dockerfile FROM ollama/ollama RUN nohup bash -c "ollama serve &" && wait4x http http://127.0.0.1:11434 && ollama pull llava && ollama pull llama3 ``` However the 2nd option is not working very well, when I install the models in that way every request take a lot of time to finish, and sometimes it doesn't finishes, it simply hangs, not sure if there's something wrong with the logic, I copied from the #957 issue.
GiteaMirror added the feature request label 2026-04-12 15:38:59 -05:00
Author
Owner

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

https://github.com/ollama/ollama/issues/7046#issuecomment-2383792234

<!-- gh-comment-id:2442145306 --> @rick-github commented on GitHub (Oct 28, 2024): https://github.com/ollama/ollama/issues/7046#issuecomment-2383792234
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4707