Subsequent running of container fails with unable to find image

When running an existing container with sudo docker run it always fails with “Unable to find image”.
Running a new container works without problems:

sudo docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
Unable to find image 'ollama/ollama:latest' locally
latest: Pulling from ollama/ollama
76249c7cd503: Pull complete 
a345b09f53f0: Pull complete 
ae509cee7641: Pull complete 
45fafbfc0e26: Pull complete 
Digest: sha256:a5409cb903d30f9cd67e9f430dd336ddc9274e16fd78f75b675c42065991b4fd
Status: Downloaded newer image for ollama/ollama:latest
4766115fe618918abc038368ad081a7c158989d2ed42e5d821f4742066c329fd

sudo docker ps
CONTAINER ID   IMAGE           COMMAND               CREATED          STATUS          PORTS                                             NAMES
4766115fe618   ollama/ollama   "/bin/ollama serve"   40 seconds ago   Up 33 seconds   0.0.0.0:11434->11434/tcp, [::]:11434->11434/tcp   ollama

After stopping the container and the trying to run it again fails:

sudo docker stop ollama

sudo docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

sudo docker run ollama
Unable to find image 'ollama:latest' locally
docker: Error response from daemon: pull access denied for ollama, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

sudo docker ps -a
CONTAINER ID   IMAGE           COMMAND               CREATED         STATUS                      PORTS     NAMES
4766115fe618   ollama/ollama   "/bin/ollama serve"   3 minutes ago   Exited (0) 34 seconds ago             ollama

sudo docker images
REPOSITORY      TAG       IMAGE ID       CREATED      SIZE
ollama/ollama   latest    9321365ae914   4 days ago   2.26GB

Does anyone have an idea how to resolve this?

Running on:

  • Ubuntu Desktop 24.04.3 LTS
  • Docker engine version 28.4.0, build d8eb465

What I already tried to resolve the issue:

  • Completely uninstalled docker following the instructions on Ubuntu | Docker Docs and re-installed
  • Clear docker cache with sudo docker system prune -a
  • Tried other images, all give the same error

It seems the image is changed from ollama/ollama:latest to ollama:latest.

Try docker inspect ollama.

Thanks for your reply! When running sudo docker inspect ollama and looking for the image in "Config¨: { it shows "Image": "ollama/ollama".

It also has the image property "Image": "sha256:9321365ae914731a4f6e7e3e0c843229276cc03ff3d5853f7dd4560cc056c222" which is the correct ID compared to the image.

sudo docker image inspect 9321365ae914 gives "sha256:9321365ae914731a4f6e7e3e0c843229276cc03ff3d5853f7dd4560cc056c222" and a repo tag of "ollama/ollama:latest"

Uhm, I am not sure if I understand what your point is, but you tried to create a container using the name of an existing terminated container, instead of the required repo:tag of an image.

You could have (re-) started the exited container with sudo docker start ollama. Of course, this will only work, if it still exists and is listed by sudo docker ps -a.

You could have created a new container based on an image with sudo docker run llama/ollama or sudo docker run llama/ollama:latest.

Ah, yes my mistake. I used run instead of start… So sorry, but thanks for replying. The container runs without problems.