Docker容器常用命令汇总

Docker常用命令总结如下:

# 查看docker详细信息

docker info

 

# 获取当前节点所有容器

docker ps -a

 

# 管理容器生命周期

docker [start|stop|restart] <containerID|containerName>

 

# 查看容器日志

docker logs <containerID|containerName>

 

# 查看容器详细信息

docker inspect [containerID|imageID]

 

# 进入容器

docker exec -it <containerID|containerName> /bin/sh

 

# 删除容器

docker rm -f <containerID|containerName>

 

# 删除镜像

docker rmi -f <imageID|imageName:tag>

 

# 查看正在运行的容器资源使用情况

docker stats <containerID|containerName>

 

# 显示容器中正在运行的进程

docker top <containerID|containerName>

 

更多关于docker的使用,可以通过--help查看

原文地址:https://www.cnblogs.com/chenli90/p/10686108.html