查看版本信息

  1. [root@k8s-1 ~]# docker version
  2. Client:
  3. Version: 18.09.6
  4. API version: 1.39
  5. Go version: go1.10.8
  6. Git commit: 481bc77156
  7. Built: Sat May 4 02:34:58 2019
  8. OS/Arch: linux/amd64
  9. Experimental: false
  10.  
  11. Server: Docker Engine - Community
  12. Engine:
  13. Version: 18.09.7
  14. API version: 1.39 (minimum version 1.12)
  15. Go version: go1.10.8
  16. Git commit: 2d0083d
  17. Built: Thu Jun 27 17:26:28 2019
  18. OS/Arch: linux/amd64
  19. Experimental: false

  查看帮助

  1. Flag shorthand -h has been deprecated, please use --help
  2.  
  3. Usage: docker [OPTIONS] COMMAND
  4.  
  5. A self-sufficient runtime for containers
  6.  
  7. Options:
  8. --config string Location of client config files (default "/root/.docker")
  9. -D, --debug Enable debug mode
  10. -H, --host list Daemon socket(s) to connect to
  11. -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
  12. --tls Use TLS; implied by --tlsverify
  13. --tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")
  14. --tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")
  15. --tlskey string Path to TLS key file (default "/root/.docker/key.pem")
  16. --tlsverify Use TLS and verify the remote
  17. -v, --version Print version information and quit
  18.  
  19. Management Commands: 最新版本命令分组
  20. builder Manage builds
  21. config Manage Docker configs
  22. container Manage containers
  23. engine Manage the docker engine
  24. image Manage images
  25. network Manage networks
  26. node Manage Swarm nodes
  27. plugin Manage plugins
  28. secret Manage Docker secrets
  29. service Manage services
  30. stack Manage Docker stacks
  31. swarm Manage Swarm
  32. system Manage Docker
  33. trust Manage trust on Docker images
  34. volume Manage volumes
  35.  
  36. Commands:
  37. attach Attach local standard input, output, and error streams to a running container
  38. build Build an image from a Dockerfile
  39. commit Create a new image from a container's changes
  40. cp Copy files/folders between a container and the local filesystem
  41. create Create a new container
  42. diff Inspect changes to files or directories on a container's filesystem
  43. events Get real time events from the server
  44. exec Run a command in a running container
  45. export Export a container's filesystem as a tar archive
  46. history Show the history of an image
  47. images List images
  48. import Import the contents from a tarball to create a filesystem image
  49. info Display system-wide information
  50. inspect Return low-level information on Docker objects
  51. kill Kill one or more running containers
  52. load Load an image from a tar archive or STDIN
  53. login Log in to a Docker registry
  54. logout Log out from a Docker registry
  55. logs Fetch the logs of a container
  56. pause Pause all processes within one or more containers
  57. port List port mappings or a specific mapping for the container
  58. ps List containers
  59. pull Pull an image or a repository from a registry
  60. push Push an image or a repository to a registry
  61. rename Rename a container
  62. restart Restart one or more containers
  63. rm Remove one or more containers
  64. rmi Remove one or more images
  65. run Run a command in a new container
  66. save Save one or more images to a tar archive (streamed to STDOUT by default)
  67. search Search the Docker Hub for images
  68. start Start one or more stopped containers
  69. stats Display a live stream of container(s) resource usage statistics
  70. stop Stop one or more running containers
  71. tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  72. top Display the running processes of a container
  73. unpause Unpause all processes within one or more containers
  74. update Update configuration of one or more containers
  75. version Show the Docker version information
  76. wait Block until one or more containers stop, then print their exit codes
  77.  
  78. Run 'docker COMMAND --help' for more information on a command.

  查看docker信息;https://www.cnblogs.com/rdchenxi/p/10674479.html 存储驱动相关信息

  1. [root@k8s-1 ~]# docker info
  2. Containers: 0 所有容器
  3. Running: 0 运行状态的容器
  4. Paused: 0 暂停状态
  5. Stopped: 0 停止状态
  6. Images: 0 容器镜像的个数
  7. Server Version: 18.09.7 版本
  8. Storage Driver: overlay2 存储驱动
  9. Backing Filesystem: xfs
  10. Supports d_type: true
  11. Native Overlay Diff: true
  12. Logging Driver: json-file
  13. Cgroup Driver: cgroupfs
  14. Plugins:
  15. Volume: local
  16. Network: bridge host macvlan null overlay
  17. Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
  18. Swarm: inactive
  19. Runtimes: runc
  20. Default Runtime: runc
  21. Init Binary: docker-init
  22. containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
  23. runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
  24. init version: fec3683
  25. Security Options:
  26. seccomp
  27. Profile: default
  28. Kernel Version: 3.10.0-957.el7.x86_64
  29. Operating System: CentOS Linux 7 (Core)
  30. OSType: linux
  31. Architecture: x86_64
  32. CPUs: 2
  33. Total Memory: 3.683GiB
  34. Name: k8s-1
  35. ID: JIYY:UFEX:ANGL:JOPR:VKFT:V6HG:LRY7:KWUY:36KV:JSAK:U7QY:54YF
  36. Docker Root Dir: /var/lib/docker
  37. Debug Mode (client): false
  38. Debug Mode (server): false
  39. Registry: https://index.docker.io/v1/
  40. Labels:
  41. Experimental: false
  42. Insecure Registries:
  43. 127.0.0.0/8
  44. Registry Mirrors:
  45. http://f1361db2.m.daocloud.io/
  46. Live Restore Enabled: false
  47. Product License: Community Engine
  48.  
  49. WARNING: bridge-nf-call-iptables is disabled
  50. WARNING: bridge-nf-call-ip6tables is disabled

  搜索镜像

  1. [root@k8s-1 ~]# docker search nginx
  2. NAME DESCRIPTION STARS OFFICIAL AUTOMATED
  3. nginx Official build of Nginx. 11654 [OK]
  4. jwilder/nginx-proxy Automated Nginx reverse proxy for docker con 1623 [OK]
  5. richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable of 724 [OK]
  6. bitnami/nginx Bitnami nginx Docker Image 68 [OK]
  7. linuxserver/nginx An Nginx container, brought to you by LinuxS 65
  8. tiangolo/nginx-rtmp Docker image with Nginx using the nginx-rtmp 48 [OK]
  9. nginx/nginx-ingress NGINX Ingress Controller for Kubernetes 20
  10. nginxdemos/hello NGINX webserver that serves a simple page co 17 [OK]
  11. schmunk42/nginx-redirect A very simple container to redirect HTTP tra 17 [OK]
  12. jlesage/nginx-proxy-manager Docker container for Nginx Proxy Manager 16 [OK]
  13. crunchgeek/nginx-pagespeed Nginx with PageSpeed + GEO IP + VTS + more_s 13
  14. blacklabelops/nginx Dockerized Nginx Reverse Proxy Server. 12 [OK]
  15. centos/nginx-18-centos7 Platform for running nginx 1.8 or building n 11
  16. centos/nginx-112-centos7 Platform for running nginx 1.12 or building 9
  17. webdevops/nginx Nginx container 8 [OK]
  18. nginxinc/nginx-unprivileged Unprivileged NGINX Dockerfiles 7
  19. sophos/nginx-vts-exporter Simple server that scrapes Nginx vts stats a 5 [OK]
  20. 1science/nginx Nginx Docker images that include Consul Temp 4 [OK]
  21. nginx/nginx-prometheus-exporter NGINX Prometheus Exporter 4
  22. mailu/nginx Mailu nginx frontend 3 [OK]
  23. travix/nginx NGinx reverse proxy 2 [OK]
  24. pebbletech/nginx-proxy nginx-proxy sets up a container running ngin 2 [OK]
  25. wodby/nginx Generic nginx 0 [OK]
  26. ansibleplaybookbundle/nginx-apb An APB to deploy NGINX 0 [OK]
  27. centos/nginx-110-centos7 Platform for running nginx 1.10 or building 0

  下载镜像操作

  1. [root@k8s-1 ~]# docker pull centos # 镜像下载
  2. Using default tag: latest
  3. latest: Pulling from library/centos
  4. 8ba884070f61: Pull complete
  5. Digest: sha256:ca58fe458b8d94bc6e3072f1cfbd334855858e05e1fd633aa07cf7f82b048e66
  6. Status: Downloaded newer image for centos:latest
  7. [root@k8s-1 ~]# docker image pull tomcat #镜像下载
  8. Using default tag: latest
  9. latest: Pulling from library/tomcat
  10. 6f2f362378c5: Pull complete
  11. 494c27a8a6b8: Pull complete
  12. 7596bb83081b: Pull complete
  13. 372744b62d49: Pull complete
  14. fb72767f9beb: Pull complete
  15. 3fe571af508a: Pull complete
  16. 3e6725074325: Pull complete
  17. 9ffd5dadda90: Pull complete
  18. 846896c59095: Pull complete
  19. cfe9a252095d: Pull complete
  20. Digest: sha256:fdc521aa1113dc07e386fa55e69670b76130a7d9490094acd52e9d4f4218e9e1
  21. Status: Downloaded newer image for tomcat:latest

  查看本机镜像

  1. [root@k8s-1 ~]# docker images
  2. REPOSITORY TAG IMAGE ID CREATED SIZE
  3. tomcat latest 7123ec940c88 2 days ago 510MB
  4. nginx latest f68d6e55e065 4 days ago 109MB
  5. centos latest 9f38484d220f 3 months ago 202MB
  6. [root@k8s-1 ~]# docker image ls
  7. REPOSITORY TAG IMAGE ID CREATED SIZE
  8. tomcat latest 7123ec940c88 2 days ago 510MB
  9. nginx latest f68d6e55e065 4 days ago 109MB
  10. centos latest 9f38484d220f 3 months ago 202MB

  删除镜像

  1. [root@k8s-1 ~]# docker image rm centos
  2. Untagged: centos:latest
  3. Untagged: centos@sha256:ca58fe458b8d94bc6e3072f1cfbd334855858e05e1fd633aa07cf7f82b048e66
  4. Deleted: sha256:9f38484d220fa527b1fb19747638497179500a1bed8bf0498eb788229229e6e1
  5. Deleted: sha256:d69483a6face4499acb974449d1303591fcbb5cdce5420f36f8a6607bda11854
  6. [root@k8s-1 ~]# docker rmi nginx:latest
  7. Untagged: nginx:latest
  8. Untagged: nginx@sha256:3abaed99ee6cb6140cb10110422cf1ece83c49ad63f7c27708994fceda565e80
  9. Deleted: sha256:f68d6e55e06520f152403e6d96d0de5c9790a89b4cfc99f4626f68146fa1dbdc
  10. Deleted: sha256:1b0c768769e2bb66e74a205317ba531473781a78b77feef8ea6fd7be7f4044e1
  11. Deleted: sha256:34138fb60020a180e512485fb96fd42e286fb0d86cf1fa2506b11ff6b945b03f
  12. Deleted: sha256:cf5b3c6798f77b1f78bf4e297b27cfa5b6caa982f04caeb5de7d13c255fd7a1e
  13. [root@k8s-1 ~]# docker images
  14. REPOSITORY TAG IMAGE ID CREATED SIZE
  15. tomcat latest 7123ec940c88 2 days ago 510MB

  容器的操作

  1. [root@k8s-1 ~]# docker container
  2.  
  3. Usage: docker container COMMAND
  4.  
  5. Manage containers
  6.  
  7. Commands:
  8. attach Attach local standard input, output, and error streams to a running container
  9. commit Create a new image from a container's changes
  10. cp Copy files/folders between a container and the local filesystem
  11. create Create a new container
  12. diff Inspect changes to files or directories on a container's filesystem
  13. exec Run a command in a running container
  14. export Export a container's filesystem as a tar archive
  15. inspect Display detailed information on one or more containers
  16. kill Kill one or more running containers
  17. logs Fetch the logs of a container
  18. ls List containers
  19. pause Pause all processes within one or more containers
  20. port List port mappings or a specific mapping for the container
  21. prune Remove all stopped containers
  22. rename Rename a container
  23. restart Restart one or more containers
  24. rm Remove one or more containers
  25. run Run a command in a new container
  26. start Start one or more stopped containers
  27. stats Display a live stream of container(s) resource usage statistics
  28. stop Stop one or more running containers
  29. top Display the running processes of a container
  30. unpause Unpause all processes within one or more containers
  31. update Update configuration of one or more containers
  32. wait Block until one or more containers stop, then print their exit codes
  33.  
  34. Run 'docker container COMMAND --help' for more information on a command.

  查看本机容器

  1. [root@k8s-1 ~]# docker ps
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. [root@k8s-1 ~]# docker container ls
  4. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

  启动一个容器

  1. [root@k8s-1 ~]# docker run --name b1 -it busybox # 交互进入
  2. / #

  

查看本机docker网络

  1. [root@k8s-1 ~]# docker network ls
  2. NETWORK ID NAME DRIVER SCOPE
  3. 62a3329169cf bridge bridge local
  4. fe7f27a4396a host host local
  5. d72117fcea57 none null local

  查看容器日志

  1. [root@k8s-1 ~]# docker container logs nginx

  

  

docker 的实践操作的更多相关文章

  1. 【实战】Docker入门实践二:Docker服务基本操作 和 测试Hello World

    操作环境 操作系统:CentOS7.2 内存:1GB CPU:2核 Docker服务常用命令 docker服务操作命令如下 service docker start #启动服务 service doc ...

  2. Docker 容器高级操作[Docker 系列-3]

    关注公众号,大家可以在公众号后台回复“博客园”,免费获得作者 Java 知识体系/面试必看资料. 上篇文章向读者介绍了一个 Nginx 的例子,对于 Nginx 这样一个容器而言,当它启动成功后,我们 ...

  3. kmeans算法原理以及实践操作(多种k值确定以及如何选取初始点方法)

    kmeans一般在数据分析前期使用,选取适当的k,将数据聚类后,然后研究不同聚类下数据的特点. 算法原理: (1) 随机选取k个中心点: (2) 在第j次迭代中,对于每个样本点,选取最近的中心点,归为 ...

  4. 关于 Docker 镜像的操作,看完这篇就够啦 !(下)

    紧接着上篇<关于 Docker 镜像的操作,看完这篇就够啦 !(上)>,奉上下篇 !!! 镜像作为 Docker 三大核心概念中最重要的一个关键词,它有很多操作,是您想学习容器技术不得不掌 ...

  5. Docker入门 - 002 Docker 的简单操作

    系统要求:CentOS 7.2 64 位操作系统. Docker 的简单操作 下载镜像 下载一个官方的 CentOS 镜像到本地 docker pull centos 下载好的镜像就会出现在镜像列表里 ...

  6. docker简易实践

    docker简易实践 实验环境 操作系统:deepin 15.4 安装步骤 1.安装docker sudo apt-get install docker.io 2.启动docker服务 sudo se ...

  7. 这是一次 docker 入门实践

    前言 其实接触 docker 也有一段时间了,但是一直没有做下总结,现在网上关于 docker 的介绍也有很多了,本着好记性不如烂笔头的原则,还是自己再记录一波吧. 实现目标 安装 docker ce ...

  8. docker最佳实践-----美团点评的分享

    美团点评容器平台简介 本文介绍美团点评的Docker容器集群管理平台(以下简称“容器平台”).该平台始于2015年,是基于美团云的基础架构和组件而开发的Docker容器集群管理平台.目前该平台为美团点 ...

  9. Jasperreport+ireport 实践操作及web应用

    Jasperreport+ireport 实践操作及web应用   学习完jasperreports+ireport,给我感觉深刻,不仅掌握了报表开发技术,还掌握了怎样在web中生成pdf,xls,r ...

随机推荐

  1. class实现React继承以及constructor的super的问题

    看这篇文章之前 建议先看看阮一峰 的Class继承 便于更好的理解 首先要知道一个问题 React的父子组件和组件类的继承有什么关系?答案是:没有关系 父子组件:指的得是组件标签包含关系 父子组件通过 ...

  2. C语言程序设计(三)——顺序程序设计

    目录: 常量.c 常量分类:   (1)字面常量(直接常量):数值常量(分为整型常量和浮点型常量).字符串常量和字符常量 (2)符号常量 (3)常变量 \f,换页,将当前位置移到下一页的开头 \v,垂 ...

  3. Python - CentOS 下 yum 安装 python3

    1. 概述 CentOS 7 自带 python2(python 以下正文简写为 py, 命令行中依然是 python) 尝试用 yum 安装 py3 2. 环境 os centos7 3. 步骤 1 ...

  4. CSS学习(7)继承、属性值的计算过程

    子元素会继承父元素的某些css属性 通常跟字体相关的属性都能被继承,具体的可以在mdn里查询是否是可继承属性 属性值的计算过程(渲染过程) 按照页面文档的树形目录结构进行依次渲染 前提条件:渲染的元素 ...

  5. Spring Boot Json 之 Jackjson Fastjson

    Json 是目前互联网应用使用最为广泛的信息交换格式之一.Spring Boot 内置了 Jackson .Json 在应用中主要体现在以下功能: 序列化 反序列化 字段格式化 验证自动化 目前长用的 ...

  6. 吴裕雄 python 机器学习——模型选择数据集切分

    import numpy as np from sklearn.model_selection import train_test_split,KFold,StratifiedKFold,LeaveO ...

  7. 使用Log4net记录日志(非常重要)

    使用Log4net记录日志   首先说说为什么要进行日志记录.在一个完整的程序系统里面,日志系统是一个非常重要的功能组成部分.它可以记录下系统所产生的所有行为,并按照某种规范表达出来.我们可以使用日志 ...

  8. Python学习笔记(01)

    参考书:<Python编程:从入门到实践> 还有其他 Chapter01 print print(a,b,sep="|") sep规定输出间的间隔 print(“Pyt ...

  9. netty学习1

    1.IO java 自带IO流 1)同步处理方式,一个请求占用一个线程,高并发常见出现问题 2.java nio 实在jdk1.4版本上新添加的new IO / 非阻塞IO 可多路并发 3.Netty ...

  10. python练习:斐波那契数列的递归实现

    python练习:斐波那契数列的递归实现 重难点:递归的是实现 def fib(n): if n==0 or n==1: return 1 else: return fib(n-1)+fib(n-2) ...