From charlesreid1

No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 13: Line 13:
</pre>
</pre>


or, if the Image ID that's listed is f302bdee6de0, you would execute the command:


[[Category:Docker]]
<pre>
$ docker rmi f302bdee6de0
</pre>
 
 
 
{{DockerFlag}}

Latest revision as of 18:57, 23 September 2017

if you have an image that you downloaded from Dockerhub and you decide you don't want it anymore, you first have to shut down and then delete any Docker containers that used that Docker image.

To remove all your old containers that are not running, run:

$ docker rm $(docker ps -aq)

Now, old containers that were not running have been removed, and you're ready to delete the image. Suppose the image is from user stinky and its called nogood:

$ docker rmi stinky/nogood

or, if the Image ID that's listed is f302bdee6de0, you would execute the command:

$ docker rmi f302bdee6de0