Home  >  Q&A  >  body text

docker-images - docker 删除所有容器

root@iZ28krk4xlkZ:/var/lib# docker rm `docker ps -a -q`
958e1b65cde0
f4997df56049
4c258585a82c
3e4021f0b9e6
79537a175735
95751e6b23bf
root@iZ28krk4xlkZ:/var/lib# docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
swarm                   latest              eb7c36c2df64        18 hours ago        17.15 MB
rethinkdb               latest              53c589ee884f        26 hours ago        181.8 MB
alpine                  latest              2314ad3eeb90        2 weeks ago         4.794 MB
shipyard/docker-proxy   latest              276373c72857        5 weeks ago         9.468 MB
shipyard/shipyard       latest              4db14669ff0c        8 weeks ago         58.73 MB
ehazlett/curl           latest              b26cc0beea49        5 months ago        8.751 MB
microbox/etcd           latest              96192a5fe39d        5 months ago        17.87 MB

已经全部删除了 ,为何查看镜像还有呢 ?

迷茫迷茫2758 days ago668

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-24 09:12:46

    What you delete is the instance running the image. To delete the image, use docker rmi + image name or the string of characters

    reply
    0
  • ringa_lee

    ringa_lee2017-04-24 09:12:46

    Image and container are two concepts. An image can be understood as a class object, and a container can be understood as an instance of a class.

    reply
    0
  • 高洛峰

    高洛峰2017-04-24 09:12:46

    docker rm is to delete the container, and your docker images is to list the images. Images and containers are different concepts.

    reply
    0
  • Cancelreply