Docker CLI 命令行介绍

Docker Version

Windows (Intel芯片)

  1. $ docker version
  2. Client: Docker Engine - Community
  3. Cloud integration: 1.0.12
  4. Version: 20.10.5
  5. API version: 1.41
  6. Go version: go1.13.15
  7. Git commit: 55c4c88
  8. Built: Tue Mar 2 20:14:53 2021
  9. OS/Arch: windows/amd64
  10. Context: default
  11. Experimental: true
  12. Server: Docker Engine - Community
  13. Engine:
  14. Version: 20.10.5
  15. API version: 1.41 (minimum version 1.12)
  16. Go version: go1.13.15
  17. Git commit: 363e9a8
  18. Built: Tue Mar 2 20:15:47 2021
  19. OS/Arch: linux/amd64
  20. Experimental: false
  21. containerd:
  22. Version: 1.4.4
  23. GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
  24. runc:
  25. Version: 1.0.0-rc93
  26. GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
  27. docker-init:
  28. Version: 0.19.0
  29. GitCommit: de40ad0

Linux(Intel芯片)

  1. docker version
  2. Client: Docker Engine - Community
  3. Version: 20.10.0
  4. API version: 1.41
  5. Go version: go1.13.15
  6. Git commit: 7287ab3
  7. Built: Tue Dec 8 18:59:40 2020
  8. OS/Arch: linux/amd64
  9. Context: default
  10. Experimental: true
  11. Server: Docker Engine - Community
  12. Engine:
  13. Version: 20.10.0
  14. API version: 1.41 (minimum version 1.12)
  15. Go version: go1.13.15
  16. Git commit: eeddea2
  17. Built: Tue Dec 8 18:57:45 2020
  18. OS/Arch: linux/amd64
  19. Experimental: false
  20. containerd:
  21. Version: 1.4.3
  22. GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
  23. runc:
  24. Version: 1.0.0-rc92
  25. GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
  26. docker-init:
  27. Version: 0.19.0
  28. GitCommit: de40ad0

Mac (Intel芯片)

  1. $ docker version
  2. Client: Docker Engine - Community
  3. Cloud integration: 1.0.9
  4. Version: 20.10.5
  5. API version: 1.41
  6. Go version: go1.13.15
  7. Git commit: 55c4c88
  8. Built: Tue Mar 2 20:13:00 2021
  9. OS/Arch: darwin/amd64
  10. Context: default
  11. Experimental: true
  12. Server: Docker Engine - Community
  13. Engine:
  14. Version: 20.10.5
  15. API version: 1.41 (minimum version 1.12)
  16. Go version: go1.13.15
  17. Git commit: 363e9a8
  18. Built: Tue Mar 2 20:15:47 2021
  19. OS/Arch: linux/amd64
  20. Experimental: false
  21. containerd:
  22. Version: 1.4.3
  23. GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
  24. runc:
  25. Version: 1.0.0-rc92
  26. GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
  27. docker-init:
  28. Version: 0.19.0
  29. GitCommit: de40ad0

docker命令行的基本使用

docker + 管理的对象(比如容器,镜像) + 具体操作(比如创建,启动,停止,删除)

例如

  • docker image pull nginx 拉取一个叫nginx的docker image镜像
  • docker container stop web 停止一个叫web的docker container容器