查看正在运行的容器
# docker ps -q 9b9f97905e36
停用全部运行的容器
# docker stop $(docker ps -q) 9b9f97905e36
删除全部容器
# docker rm $(docker ps -aq) 9b9f97905e36 ce255ba7637e f126bad55cac c10a4c3541f5 1949036422c3 518abb0ea706 8e44bd1abf81 df01fe711d00 0931fac89930 1e16b5a972af 15c0cb22672e 241a780f8634
一条命令实现停用并删除容器
root@ThinkPad:/home/jiqing# docker run -d -p 9000:80 jiqing9006/centos:httpd /bin/sh -c /usr/local/bin/start.sh 0a9d3b5e5f957cc87abc396486abd07e325f5c70f46f0149e22efb5e0a4f8a24 root@ThinkPad:/home/jiqing# docker ps -aq 0a9d3b5e5f95 root@ThinkPad:/home/jiqing# docker stop $(docker ps -q) && docker rm $(docker ps -aq) 0a9d3b5e5f95 0a9d3b5e5f95
删除不运行的容器
# docker container prune WARNING! This will remove all stopped containers. Are you sure you want to continue? [y/N] y Deleted Containers: 38fcd72cc70b07c2ca991e4f7681d192c24f9e89c96f48f9a1505cb736beecc7 Total reclaimed space: 0B
删除所有镜像(谨慎操作)
# docker rmi $(docker images -q)
西部数码的容器云产品是通过docker技术,在集群服务器上部署容器服务实现,功能强大、简单易用,拥有上万linux镜像,秒级开通,轻量级的容器云产品链接 https://www.west.cn/paas/container/