Error response from daemon: conflict: unable to remove repository reference "portainer/portainer:latest" (must force)

Viewed 3075

I am trying docker run -t noya locally. I can't seem to reach the http://127.0.0.1:9000/ and I can not log in to portainer.io when entering my password.

Now, I am trying to uninstall portainer (to create a new one with a new password for portainer.io) with the command

docker rmi portainer/portainer:latest

but I keep getting the error

Error response from daemon: conflict: unable to remove repository reference "portainer/portainer:latest" (must force) - container 5cffeb45c973 is using its referenced image 10383f5b5720

Whereas, when I visualize the containers running with docker container ls there is nothing showing meaning there is no containers running.

How can I stop the container 5cffeb45c973 from running in order to remove the portainer/portainer:latest image?

PS: I am a newbie to docker.

EDIT:

I tried to remove container 5cffeb45c973 using docker container rm 5cffeb45c973

Then, docker rmi portainer/portainer:latest

Same error returned as follows

Error response from daemon: conflict: unable to remove repository reference "portainer/portainer:latest" (must force) - container 2ee006f771cf is using its referenced image 10383f5b5720

Apparently a new container with ID 2ee006f771cf has been automatically referenced to the portainer image

1 Answers

The reason I wanted to delete the portainer image is because I forgot my initial password to portainer.io Problem reserved by removing the portainer_data by running:

remove container running

docker container rm {container_running_id} --force

remove volume

docker volume rm portainer_data

recreate a new portainer_data volume

docker volume create portainer_data docker

run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Now, when you go to http://localhost:9000/ you will be asked to enter a new password for admin just like the first time

Related