User Tools

Site Tools


docker:remove_an_image

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker:remove_an_image [2017/02/22 15:05] peterdocker:remove_an_image [2020/05/13 08:45] (current) – removed peter
Line 1: Line 1:
-====== Docker - Remove an image ====== 
- 
-===== Find the image ===== 
- 
-<code bash> 
-docker images 
-</code> 
- 
-Returns 
- 
-<code> 
-REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE 
-ubuntu              16.10               df4ba6fcd70e        36 hours ago        100.2 MB 
-ubuntu              16.04               f753707788c5        36 hours ago        127.2 MB 
-ubuntu              latest              f753707788c5        36 hours ago        127.2 MB 
-hello-world         latest              c54a2cc56cbb        3 months ago        1.848 kB 
-docker/whalesay     latest              6b362a9f73eb        16 months ago       247 MB 
-</code> 
- 
-<code bash> 
-docker rmi image_name 
-</code> 
- 
-Seeing all created containers is as simple as docker ps -a. 
- 
-To remove all existing containers (not images!) run docker rm $(docker ps -aq) 
- 
- 
-===== Removing images according to a pattern ===== 
- 
-You can find all the images that match a pattern using a combination of docker images and grep.  Once you're satisfied, you can delete them by using awk to pass the IDs to docker rmi.  Note that these utilities are not supplied by Docker and are not necessarily available on all systems: 
- 
- 
-To find the images: 
- 
-<code bash> 
-docker ps -a |  grep "pattern" 
-</code> 
- 
-To remove the images: 
- 
-<code bash> 
-docker images | grep "pattern" | awk '{print $1}' | xargs docker rm 
-</code> 
- 
  
docker/remove_an_image.1487775947.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki