2145 shaares
906 private links
906 private links
So to fetch all the unused docker images without actually pruning them, you could do the following
- Fetch all the images belonging to the running containers(which are not stopped or exited)
- Fetch all the images on the machine
- Then filter the images in step 1 from step 2
Below are the shell commands:
runningImages=$(docker ps --format {{.Image}})
docker images --format "{{.ID}} {{.Repository}}:{{.Tag}}" | grep -v "$runningImages"