1、docker的命令格式
# 基本格式如下:# docker 命令关键字(command) 一系列参数docker version docker版本信息docker info 守护进程的系统资源设置镜像操作:docker search 搜索镜像(仓库)docker pull 拉取镜像(仓库)docker push 推送镜像(仓库)docker images 镜像的查询(本地)docker rmi 镜像的删除(本地)容器操作docker ps 容器的查询docker run 容器的创建启动docker start/restart/pause/unpause/stop 容器启动/重启/暂停/恢复暂停/停止docker rm 删除容器docker inspect 查看容器所有基本信息docker logs 查看容器日志信息docker stats 查看容器所占用的资源其他操作docker commit 从容器创建一个新的镜像docker build -t 使用 Dockerfile 创建镜像docker save -o o xx.xx.xxxx.xx.xxxx.xx.xx.tardocker load -i xx.xx.xx.tar
2、docker命令中常见的其他参数
-f 指定使用yaml文件的位置up -d 启动容器config -q 验证yaml配置文件是否正确
3、docker查看所有状态为exited的容器
# 查看未启动的所有容器docker ps -f status=exited#删除所有未启动的容器docker rm $(docker ps -q -f status=exited)