0

I want to delete these two images

dockersamples/visualizer                <none>              8dbf7c60cf88        22 months ago       148MB
dockersamples/examplevotingapp_result   <none>              e10df791f13c        2 years ago         227MB

I tried everything,problem is that when I stop and delete container,they create the new one. I tried

docker rmi $(docker images -a -q)
Untagged: tomcat:latest
Untagged: tomcat@sha256:cea26a23e1ebdbebdddde1e02a10e655b0b386d8de6002301a037a08be87a12f
Deleted: sha256:5377fd8533c34a4b1a909ff56d1ccc5b61f8bda1901b1c3c7e69cc3534cf25c2
Deleted: sha256:6593cb376a4f95448251a326806ad3f452481a6f96e9b1debf4fcc5bf5413328
Deleted: sha256:065f6b7f3a853eff8da8b651f8574320e7637b811fb10adf588f1c8a36a42793
Deleted: sha256:0388835b21d764f276baf4be8396cc22e84a6f442402d03b437fc61e81e4acea
Deleted: sha256:055d339f8c77be047597bab013bef0056e2b6a414a1225b12539637dcb59482b
Deleted: sha256:58136eb1ff2719ed3f6a8ef410a2989960f99a7988112e81017638b4527be1c4
Deleted: sha256:e6d9e14c5186b2546854328eb17f83bb72690820379af71d8b4ad7a566e77085
Deleted: sha256:81bea2e4eb39ed9ed1ceb0e8ca05cefbdc96bd0b38266c26990c1eb0ed528612
Deleted: sha256:5707f840eb6421a463261e9f62c9fcc691facd718993a666d5c86751ebb57cc3
Deleted: sha256:706c0c43e07bd77aba42160b0d0158297caec76c4da6566d856f28b1754f2265
Deleted: sha256:0db06dff9d9aeb9bed4edde7bd772ad0f3aea497c129d48ed587664d098c6c41
Untagged: nginx:latest
Untagged: nginx@sha256:12db363acf5b2d2f9f5fed240e228a04692bdac68402430fbd2f720c3a967d01
Deleted: sha256:62c261073ecffe22a28f2ba67760a9320bc4bfe8136a83ba9b579983346564be

But

Error response from daemon: conflict: unable to delete ba2730fb15d4 (cannot be forced) - image is being used by running container cc3dd153eea1
Error: No such image: 81f545dad9c7
Error: No such image: 19b3e7672486
Error: No such image: 28ce82ebe756
Error: No such image: b860ab44e93e
Error response from daemon: conflict: unable to delete 8dbf7c60cf88 (cannot be forced) - image is being used by running container e9978660072a
Error response from daemon: conflict: unable to delete e10df791f13c (cannot be forced) - image is being used by running container 3b42e7e6e4f2

I cloned code votingapp The issue is that images are deployed with docker swarm

docker stack deploy --compose-file docker-stack.yml vote

I don't have much experience with swarm,I am not sure should I leave the swarm or not.

docker node ls
ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
iiq90umkuazv565mzw0imyycg *   miki                Ready               Active              Leader              18.09.6

How to get out of circle?

2
  • Have you tried docker rm -f <container-id> to first forcefully remove the container and then docker rmi -f <image-id> to forcefully delete the images. Commented Jun 20, 2019 at 15:50
  • Yes, I did. The swarm will create the new container,so it is more complicated than that. Commented Jun 20, 2019 at 16:06

1 Answer 1

1

docker service ls

docker service rm <service_ID>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.