'Docker - extended options for docker image purge
I am not able to find the way to delete a certain Docker Image using the IMAGE ID and I can't figure it out from the Docker Documentation.
the syntax is: docker image prune --filter "label=key=value"
How can I delete image with ID=24de51a55d98 (second image) from the output below?
root@ubuntu:/home/vg/proj# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
vbgtest2018/node_p latest 0eca292619dd 17 minutes ago 174MB
**None None 24de51a55d98 23 minutes ago 170MB**
node alpine 025c3cbb849f 11 days ago 169MB
Solution 1:[1]
use docker rmi command.
rmi - remove image
docker rmi [OPTIONS] IMAGE [IMAGE...]
in your case-
docker rmi 24de51a55d98
or even you can use
docker rmi -f 24de51a55d98
Solution 2:[2]
Can be done with this command -
docker image rm {image-id} -f
In you case
docker image rm 24de51a55d98 -f
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ravindra Bagale |
| Solution 2 |
