This is an example repository to show how to build an Ollama model downloader for Docker builds. This tool can download Ollama models during a Docker build. Although almost all functions in the Ollama are exported the dependecies are hard to get right.
FROM gerke74/ollama-model-loader as downloader
RUN /ollama-pull gemma:2b
FROM ollama/ollama
ENV OLLAMA_HOST "0.0.0.0"
COPY --from=downloader /root/.ollama /root/.ollama