Skip to content

Use curl instead ollama docker image#105

Merged
nekomeowww merged 2 commits intonekomeowww:mainfrom
cafsenra:asenra_use_curl_image_instead_ollama_to_pull_models
Oct 17, 2025
Merged

Use curl instead ollama docker image#105
nekomeowww merged 2 commits intonekomeowww:mainfrom
cafsenra:asenra_use_curl_image_instead_ollama_to_pull_models

Conversation

@cafsenra
Copy link
Contributor

Close: #104

"-c",
// TODO: This is a temporary solution, we need to find a better way to preload the models
fmt.Sprintf("apt update && apt install curl -y && ollama pull %s && curl http://ollama-models-store:11434/api/generate -d '{\"model\": \"%s\"}'", image, parsedModelName),
fmt.Sprintf("until curl -f http://ollama-models-store:11434/api/version; do echo 'Waiting for Ollama...'; sleep 5; done && curl http://ollama-models-store:11434/api/pull -H 'Content-Type: application/json' -d '{\"model\": \"%s\"}'", image, parsedModelName),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Sprintf("until curl -f http://ollama-models-store:11434/api/version; do echo 'Waiting for Ollama...'; sleep 5; done && curl http://ollama-models-store:11434/api/pull -H 'Content-Type: application/json' -d '{\"model\": \"%s\"}'", image, parsedModelName),
fmt.Sprintf("until curl -f http://ollama-models-store:11434/api/version; do echo 'Waiting for Ollama...'; sleep 5; done && curl http://ollama-models-store:11434/api/generate -H 'Content-Type: application/json' -d '{\"model\": \"%s\"}'", image, parsedModelName),

return corev1.Container{
Name: "ollama-image-pull",
Image: OllamaBaseImage,
Image: "curlimages/curl",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot run init container as non root due to apt update and apt install curl command: Proposal use curl image instead

2 participants