Victor Grecu
Victor Grecu

Reputation: 9

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

Upvotes: 0

Views: 45

Answers (2)

Saikat Roy
Saikat Roy

Reputation: 523

Can be done with this command -

docker image rm {image-id} -f

In you case

docker image rm 24de51a55d98 -f

Upvotes: 0

Ravindra Bagale
Ravindra Bagale

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

Related Questions