Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between docker rm IMAGE vs docker rmi IMAGE

According to Docker documentations, docker image rm "Remove one or more images" [1]. docker rmi has a same description [2], but then it goes on to say "Removes (and un-tags) one or more images from the host node."

Do docker image rm IMAGE and docker rmi IMAGE have an identical effect under any scenario? IMAGE is ID of the particular image that is to be removed.

like image 356
Reveille Avatar asked Jul 22 '20 12:07

Reveille


2 Answers

The man page for docker rmi specifies that docker rmi is an alias for docker image rm. I suppose the documentation from docker is a little bit inconsistent in that regard. They write all the details for docker rmi while the documentation for docker image rm is lackluster.

like image 129
octagon_octopus Avatar answered Oct 31 '22 09:10

octagon_octopus


It looks like docker rm is for containers and docker rmi is for images.

PS C:\Users\3des> docker rm httpd --force
Error: No such container: httpd
PS C:\Users\3des> docker rm httpd
Error: No such container: httpd
______________________________________________
PS C:\Users\3des> docker rmi httpd --force
Untagged: httpd:latest
Untagged: httpd@sha256:2fab99fb3b1c7ddfa99d7dc55de8dad0a62dbe3e7c605d78ecbdf2c6c49fd636
``


  
like image 23
DeShaon Taylor Avatar answered Oct 31 '22 10:10

DeShaon Taylor