Docker命令

命令 用途
docker ps -a -q --filter ancestor=ubuntu | xargs docker stop
停止ubuntu镜像的所有容器
docker ps -a -q --filter ancestor=ubuntu | xargs docker rm
删除ubuntu镜像的所有容器
docker ps -a -q -f status=exited | xargs docker rm
删除所有已经stop的container
docker rm -f container_id_or_name
强制删除容器
docker logs container_id 查看容器对应的log
docker ps --no-trunc 显示运行容器的完整命令
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

 

docker logs container_id
docker logs container_id
-q -f status=exit
-q -f status=exit
posted @ 2021-02-01 04:41  Fintech技术汇  阅读(46)  评论(0编辑  收藏  举报