skip to Main Content

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

2

Answers


  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
    
    Login or Signup to reply.
  2. Can be done with this command –

    docker image rm {image-id} -f
    

    In you case

    docker image rm 24de51a55d98 -f
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search