镜像相关

  1. docker images
  2. docker history [image] 查看镜像构建过程。
  3. docker commit [container] [image] 容器构建镜像。
  4. #docker commit keen_williamson ubuntu-with-vi
  5. docker tag [image:tag] [image:tag] 改标签/重命名。
  6. docker build Dockerfile 构建镜像。
  7. #docker build -t ubuntu-with-vi-dockerfile .
  8. docker pull/push
  9. docker rm/rmi
  10. docker search 可以搜索 Docker Hub 中的镜像。

容器相关

  1. create 创建容器
  2. run 运行容器
  3. pause 暂停
  4. unpause 取消暂停继续运行容器
  5. stop 发送 SIGTERM 停止容器
  6. kill 发送 SIGKILL 快速停止容器
  7. start 启动
  8. restart 重启
  9. attach 到容器启动进程的终端
  10. logs 显示容器启动进程的控制台输出,-f 持续打印。
  11. rm 删除容器

State Machine.png