Reputation: 9
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
Upvotes: 0
Views: 45
Reputation: 523
Can be done with this command -
docker image rm {image-id} -f
In you case
docker image rm 24de51a55d98 -f
Upvotes: 0
Reputation: 17665
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
Upvotes: 1