Docker/Removing Images: Difference between revisions
From charlesreid1
No edit summary |
Bleep bloop (talk | contribs) m (Bot: Orphan page, add template) |
||
| Line 1: | Line 1: | ||
{{Orphan|date=April 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. | 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. | ||
Revision as of 02:40, 17 April 2017
| O NOES!!!
|
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