Running Ollama with Docker
OKs, this is a quick post…
You have docker installed and now you want Ollama installed.
Its very complex… read on!
TLDR;
Run Ollama in docker
- https://ollama.com/blog/ollama-is-now-available-as-an-official-docker-image
- https://hub.docker.com/r/ollama/ollama
side note: Docker and Volumes - I can never remember this
Powershell prompt
- this is using the powershell prompt for the local volume location!
- docker desktop has a terminal… but its nicer to use my own
${pwd}
is the folder that the command is running from- i.e. I’m running this prompt from
c:\GIT\deno-ollama
so the windows folder will bec:\GIT\deno-ollama\ollama
while the linux one inside the container will beroot/.ollama
- docker-desktop lets you browse the contents under container actions
- i.e. I’m running this prompt from
Install
-
docker pull ollama/ollama:latest mkdir ollama docker run -d -v ${pwd}\ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama:latest
- note the docker image is running detached
Pull the models for Ollama
Models
- https://ollama.com/library
- i.e.
- dolphin-mistral
- llama3
- phi3.5
Running one:
-
docker exec -it ollama ollama run phi3.5
Test with localhost
- goto http://localhost:11434/
- you can check this on docker desktop
- it shows:
Ollama is running
- Yay!
If you find this useful, go be nice to someone. Pay it forward.
Cheers!