• docker入门级详解


    Docker

    1 docker安装

    1. yum install docker
    2. [root@topcheer ~]# systemctl start docker
    3. [root@topcheer ~]# mkdir -p /etc/docker
    4. [root@topcheer ~]# vim /etc/docker/daemon.json #配置阿里云镜像加速
    5. {
    6. "registry-mirrors": ["XXXXXXXXXXXXXXXX"]
    7. }
    8. [root@topcheer ~]# systemctl daemon-reload #加载配置文件 [root@topcheer ~]# systemctl restart docker #重启
    9. [root@topcheer ~]#

    2 docker命令

    2.1 docker帮助命令

    • docker version

      1. 1 [root@topcheer ~]# docker version
      2. 2 Client:
      3. 3 Version: 1.13.1
      4. 4 API version: 1.26
      5. 5 Package version: docker-1.13.1-103.git7f2769b.el7.centos.x86_64
      6. 6 Go version: go1.10.3
      7. 7 Git commit: 7f2769b/1.13.1
      8. 8 Built: Sun Sep 15 14:06:47 2019
      9. 9 OS/Arch: linux/amd64
      10. 10
      11. 11 Server:
      12. 12 Version: 1.13.1
      13. 13 API version: 1.26 (minimum version 1.12)
      14. 14 Package version: docker-1.13.1-103.git7f2769b.el7.centos.x86_64
      15. 15 Go version: go1.10.3
      16. 16 Git commit: 7f2769b/1.13.1
      17. 17 Built: Sun Sep 15 14:06:47 2019
      18. 18 OS/Arch: linux/amd64
      19. 19 Experimental: false
      20. 20 [root@topcheer ~]#
       
      
    • docker info

      1. 1 [root@topcheer ~]# docker info
      2. 2 Containers: 1
      3. 3 Running: 0
      4. 4 Paused: 0
      5. 5 Stopped: 1
      6. 6 Images: 1
      7. 7 Server Version: 1.13.1
      8. 8 Storage Driver: overlay2
      9. 9 Backing Filesystem: xfs
      10. 10 Supports d_type: true
      11. 11 Native Overlay Diff: true
      12. 12 Logging Driver: journald
      13. 13 Cgroup Driver: systemd
      14. 14 Plugins:
      15. 15 Volume: local
      16. 16 Network: bridge host macvlan null overlay
      17. 17 Swarm: inactive
      18. 18 Runtimes: docker-runc runc
      19. 19 Default Runtime: docker-runc
      20. 20 Init Binary: /usr/libexec/docker/docker-init-current
      21. 21 containerd version: (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1)
      22. 22 runc version: 9c3c5f853ebf0ffac0d087e94daef462133b69c7 (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f)
      23. 23 init version: fec3683b971d9c3ef73f284f176672c44b448662 (expected: 949e6facb77383876aeff8a6944dde66b3089574)
      24. 24 Security Options:
      25. 25 seccomp
      26. 26 WARNING: You're not using the default seccomp profile
      27. 27 Profile: /etc/docker/seccomp.json
      28. 28 selinux
      29. 29 Kernel Version: 3.10.0-957.el7.x86_64
      30. 30 Operating System: CentOS Linux 7 (Core)
      31. 31 OSType: linux
      32. 32 Architecture: x86_64
      33. 33 Number of Docker Hooks: 3
      34. 34 CPUs: 4
      35. 35 Total Memory: 1.777 GiB
      36. 36 Name: topcheer
      37. 37 ID: SR5A:YSH6:3YGH:YEZ4:PWLB:EEVE:3L5S:Z5AR:ARIA:SDGX:CZI5:MJ7O
      38. 38 Docker Root Dir: /var/lib/docker
      39. 39 Debug Mode (client): false
      40. 40 Debug Mode (server): false
      41. 41 Registry: https://index.docker.io/v1/
      42. 42 Experimental: false
      43. 43 Insecure Registries:
      44. 44 127.0.0.0/8
      45. 45 Registry Mirrors:
      46. 46 https://lara9y80.mirror.aliyuncs.com
      47. 47 Live Restore Enabled: false
      48. 48 Registries: docker.io (secure)
      49. 49 [root@topcheer ~]#
    • docker --help

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

    2.2 镜像命令

    • docker images

      1. [root@topcheer ~]# docker images
      2. REPOSITORY TAG IMAGE ID CREATED SIZE
      3. docker.io/hello-world latest fce289e99eb9 8 months ago 1.84 kB
      4. [root@topcheer ~]#
      5. REPOSITORY:表示镜像的仓库源
      6. TAG:镜像的标签
      7. IMAGE ID:镜像ID
      8. CREATED:镜像创建时间
      9. SIZE:镜像大小
      10. 同一仓库源可以有多个 TAG,代表这个仓库源的不同个版本,我们使用 REPOSITORY:TAG 来定义不同的镜像。
      11. 如果你不指定一个镜像的版本标签,例如你只使用 ubuntu,docker 将默认使用 ubuntu:latest 镜像
    • docker search

       
      
      1. [root@topcheer ~]# docker search redis
      2. INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
      3. docker.io docker.io/redis Redis is an open source key-value store th... 7342 [OK]
      4. docker.io docker.io/bitnami/redis Bitnami Redis Docker Image 127 [OK]
      5. docker.io docker.io/sameersbn/redis 77 [OK]
      6. docker.io docker.io/grokzen/redis-cluster Redis cluster 3.0, 3.2, 4.0 & 5.0 56
      7. docker.io docker.io/rediscommander/redis-commander Alpine image for redis-commander - Redis m... 31 [OK]
      8. docker.io docker.io/kubeguide/redis-master redis-master with "Hello World!" 29
      9. docker.io docker.io/redislabs/redis Clustered in-memory database engine compat... 23
      10. docker.io docker.io/arm32v7/redis Redis is an open source key-value store th... 17
      11. docker.io docker.io/redislabs/redisearch Redis With the RedisSearch module pre-load... 17
      12. docker.io docker.io/oliver006/redis_exporter Prometheus Exporter for Redis Metrics. Su... 15
      13. docker.io docker.io/webhippie/redis Docker images for Redis 10 [OK]
      14. docker.io docker.io/s7anley/redis-sentinel-docker Redis Sentinel 9 [OK]
      15. docker.io docker.io/insready/redis-stat Docker image for the real-time Redis monit... 8 [OK]
      16. docker.io docker.io/redislabs/redisgraph A graph database module for Redis 8 [OK]
      17. docker.io docker.io/arm64v8/redis Redis is an open source key-value store th... 6
      18. docker.io docker.io/bitnami/redis-sentinel Bitnami Docker Image for Redis Sentinel 6 [OK]
      19. docker.io docker.io/centos/redis-32-centos7 Redis in-memory data structure store, used... 4
      20. docker.io docker.io/redislabs/redismod An automated build of redismod - latest Re... 4 [OK]
      21. docker.io docker.io/circleci/redis CircleCI images for Redis 2 [OK]
      22. docker.io docker.io/frodenas/redis A Docker Image for Redis 2 [OK]
      23. docker.io docker.io/runnable/redis-stunnel stunnel to redis provided by linking conta... 1 [OK]
      24. docker.io docker.io/tiredofit/redis Redis Server w/ Zabbix monitoring and S6 O... 1 [OK]
      25. docker.io docker.io/wodby/redis Redis container image with orchestration 1 [OK]
      26. docker.io docker.io/cflondonservices/redis Docker image for running redis 0
      27. docker.io docker.io/xetamus/redis-resource forked redis-resource 0 [OK]
      28. [root@topcheer ~]#
    • docker pull

      1. [root@topcheer ~]# docker pull docker.io/redis
      2. Using default tag: latest
      3. Trying to pull repository docker.io/library/redis ...
      4. latest: Pulling from docker.io/library/redis
      5. b8f262c62ec6: Pull complete
      6. 93789b5343a5: Pull complete
      7. 49cdbb315637: Pull complete
      8. 2c1ff453e5c9: Pull complete
      9. 9341ee0a5d4a: Pull complete
      10. 770829e1df34: Pull complete
      11. Digest: sha256:5dcccb533dc0deacce4a02fe9035134576368452db0b4323b98a4b2ba2d3b302
      12. Status: Downloaded newer image for docker.io/redis:latest
      13. [root@topcheer ~]# docker images
      14. REPOSITORY TAG IMAGE ID CREATED SIZE
      15. docker.io/redis latest 63130206b0fa 9 days ago 98.2 MB
      16. docker.io/hello-world latest fce289e99eb9 8 months ago 1.84 kB
      17. [root@topcheer ~]#
      
      
    • docker rmi

      1. [root@topcheer ~]# docker rmi 63130206b0fa
      2. Untagged: docker.io/redis:latest
      3. Untagged: docker.io/redis@sha256:5dcccb533dc0deacce4a02fe9035134576368452db0b4323b98a4b2ba2d3b302
      4. Deleted: sha256:63130206b0fa808e4545a0cb4a1f14f6d40b8a7e2e6fda0a31fd326c2ac0971c
      5. Deleted: sha256:9476758634326bb436208264d0541e9a0d42e4add35d00c2a7408f810223013d
      6. Deleted: sha256:0f3d9de16a216bfa5e2c2bd0e3c2ba83afec01a1b326d9f39a5ea7aecc112baf
      7. Deleted: sha256:452d665d4efca3e6067c89a332c878437d250312719f9ea8fff8c0e350b6e471
      8. Deleted: sha256:d6aec371927a9d4bfe4df4ee8e510624549fc08bc60871ce1f145997f49d4d37
      9. Deleted: sha256:2957e0a13c30e89650dd6c00644c04aa87ce516284c76a67c4b32cbb877de178
      10. Deleted: sha256:2db44bce66cde56fca25aeeb7d09dc924b748e3adfe58c9cc3eb2bd2f68a1b68
      11. [root@topcheer ~]# docker images
      12. REPOSITORY TAG IMAGE ID CREATED SIZE
      13. docker.io/hello-world latest fce289e99eb9 8 months ago 1.84 kB
      14. [root@topcheer ~]#

    2.3 容器命令

    • docker run

      1. OPTIONS说明(常用):有些是一个减号,有些是两个减号
      2. --name="容器新名字": 为容器指定一个名称;
      3. -d: 后台运行容器,并返回容器ID,也即启动守护式容器;
      4. -i:以交互模式运行容器,通常与 -t 同时使用;
      5. -t:为容器重新分配一个伪输入终端,通常与 -i 同时使用;
      6. -P: 随机端口映射;
      7. -p: 指定端口映射,有以下四种格式
      8. ip:hostPort:containerPort
      9. ip::containerPort
      10. hostPort:containerPort
      11. containerPort
      12. [root@topcheer ~]# docker run -it centos /bin/bash
      13. [root@3d2a94b63807 /]# cd /
      14. [root@3d2a94b63807 /]# ll
    • docker ps

      1. OPTIONS说明(常用):
      2. -a :列出当前所有正在运行的容器+历史上运行过的
      3. -l :显示最近创建的容器。
      4. -n:显示最近n个创建的容器。
      5. -q :静默模式,只显示容器编号。
      6. --no-trunc :不截断输出。
      7. 退出容器 exit:容器停止退出 crtl p q容器不停止退出
      8. [root@topcheer ~]# docker ps
      9. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      10. 3d2a94b63807 centos "/bin/bash" 3 minutes ago Up 3 minutes nostalgic_darwin
      11. [root@topcheer ~]#
    • docker stop

      1. root@topcheer ~]# docker ps
      2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      3. 3d2a94b63807 centos "/bin/bash" 3 minutes ago Up 3 minutes nostalgic_darwin
      4. [root@topcheer ~]# docker stop 3d2a94b63807
      5. 3d2a94b63807
    • docker start

      1. [root@topcheer ~]# docker start 3d2a94b63807
      2. 3d2a94b63807
      3. [root@topcheer ~]# docker ps
      4. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      5. 3d2a94b63807 centos "/bin/bash" 6 minutes ago Up 17 seconds nostalgic_darwin
      6. [root@topcheer ~]#​
    • docker rm

      1. [root@topcheer ~]# docker rm -f $(docker ps -a -q)
      2. 3d2a94b63807
      3. 299b22d3d143
      4. [root@topcheer ~]# docker ps
      5. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      6. [root@topcheer ~]#​
    • docker run -d

      1. [root@topcheer ~]# docker run -d centos
      2. 3c618cadb296fd013384201958f175085395a505a0aa1f7727e3c24b744b0b7f
      3. [root@topcheer ~]#
      4. 问题:然后docker ps -a 进行查看, 会发现容器已经退出
      5. 很重要的要说明的一点: Docker容器后台运行,就必须有一个前台进程.
      6. 容器运行的命令如果不是那些一直挂起的命令(比如运行top,tail),就是会自动退出的。
      7. 这个是docker的机制问题,比如你的web容器,我们以nginx为例,正常情况下,我们配置启动服务只需要启动响应的service即可。例如
      8. service nginx start
      9. 但是,这样做,nginx为后台进程模式运行,就导致docker前台没有运行的应用,
      10. 这样的容器后台启动后,会立即自杀因为他觉得他没事可做了.
      11. 所以,最佳的解决方案是,将你要运行的程序以前台进程的形式运行
    • docker logs

      1. * -t 是加入时间戳
      2. * -f 跟随最新的日志打印
      3. * --tail 数字 显示最后多少条
      4. [root@topcheer ~]# docker run -d centos /bin/sh -c "while true;do echo hello zzyy;sleep 2;done"
      5. 6c4bb3ce4c35a5380b553e686b806a1581bfb8dd0a115f63fa9b14da6195e667
      6. [root@topcheer ~]# docker ps -a
      7. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      8. 6c4bb3ce4c35 centos "/bin/sh -c 'while..." 6 seconds ago Up 4 seconds eloquent_shannon
      9. 3c618cadb296 centos "/bin/bash" About a minute ago Exited (0) About a minute ago upbeat_jepsen
      10. [root@topcheer ~]# docker logs -f -t --tail 6c4bb3ce4c35
      11. "docker logs" requires exactly 1 argument(s).
      12. See 'docker logs --help'.
      13. Usage: docker logs [OPTIONS] CONTAINER
      14. Fetch the logs of a container
      15. [root@topcheer ~]# docker ps -a
      16. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      17. 6c4bb3ce4c35 centos "/bin/sh -c 'while..." 47 seconds ago Up 46 seconds eloquent_shannon
      18. 3c618cadb296 centos "/bin/bash" 2 minutes ago Exited (0) 2 minutes ago upbeat_jepsen
      19. [root@topcheer ~]# docker logs -tf --tail10 6c4bb3ce4c35
      20. unknown flag: --tail10
      21. See 'docker logs --help'.
      22. [root@topcheer ~]# docker logs -tf --tail 10 6c4bb3ce4c35
      23. 2019-09-22T10:23:14.595414000Z hello zzyy
      24. 2019-09-22T10:23:16.597109000Z hello zzyy
      25. 2019-09-22T10:23:18.600019000Z hello zzyy
      26. 2019-09-22T10:23:20.602673000Z hello zzyy
      27. 2019-09-22T10:23:22.605026000Z hello zzyy
      28. 2019-09-22T10:23:24.625059000Z hello zzyy
       
      
    • docker top 查看容器内运行的进程

      1. [root@topcheer ~]# docker top 6c4bb3ce4c35
      2. UID PID PPID C STIME TTY TIME CMD
      3. root 116050 116030 0 18:21 ? 00:00:00 /bin/sh -c while true;do echo hello zzyy;sleep 2;done
      4. root 116250 116050 2 18:25 ? 00:00:00 sleep 2
      5. [root@topcheer ~]#
    • docker inspect 查看容器内部细节

      1. [root@topcheer ~]# docker inspect 6c4bb3ce4c35
      2. [
      3. {
      4. "Id": "6c4bb3ce4c35a5380b553e686b806a1581bfb8dd0a115f63fa9b14da6195e667",
      5. "Created": "2019-09-22T10:21:57.924998005Z",
      6. "Path": "/bin/sh",
      7. "Args": [
      8. "-c",
      9. "while true;do echo hello zzyy;sleep 2;done"
      10. ],
      11. "State": {
      12. "Status": "running",
      13. "Running": true,
      14. "Paused": false,
      15. "Restarting": false,
      16. "OOMKilled": false,
      17. "Dead": false,
      18. "Pid": 116050,
      19. "ExitCode": 0,
      20. "Error": "",
      21. "StartedAt": "2019-09-22T10:21:58.43216616Z",
      22. "FinishedAt": "0001-01-01T00:00:00Z"
      23. },
      24. "Image": "sha256:67fa590cfc1c207c30b837528373f819f6262c884b7e69118d060a0c04d70ab8",
      25. "ResolvConfPath": "/var/lib/docker/containers/6c4bb3ce4c35a5380b553e686b806a1581bfb8dd0a115f63fa9b14da6195e667/resolv.conf",
      26. "HostnamePath": "/var/lib/docker/containers/6c4bb3ce4c35a5380b553e686b806a1581bfb8dd0a115f63fa9b14da6195e667/hostname",
      27. "HostsPath": "/var/lib/docker/containers/6c4bb3ce4c35a5380b553e686b806a1581bfb8dd0a115f63fa9b14da6195e667/hosts",
      28. "LogPath": "",
      29. "Name": "/eloquent_shannon",
      30. "RestartCount": 0,
      31. "Driver": "overlay2",
      32. "MountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c71,c940",
      33. "ProcessLabel": "system_u:system_r:svirt_lxc_net_t:s0:c71,c940",
      34. "AppArmorProfile": "",
      35. "ExecIDs": null,
      36. "HostConfig": {
      37. "Binds": null,
      38. "ContainerIDFile": "",
      39. "LogConfig": {
      40. "Type": "journald",
      41. "Config": {}
      42. },
      43. "NetworkMode": "default",
      44. "PortBindings": {},
      45. "RestartPolicy": {
      46. "Name": "no",
      47. "MaximumRetryCount": 0
      48. },
      49. "AutoRemove": false,
      50. "VolumeDriver": "",
      51. "VolumesFrom": null,
      52. "CapAdd": null,
      53. "CapDrop": null,
      54. "Dns": [],
      55. "DnsOptions": [],
      56. "DnsSearch": [],
      57. "ExtraHosts": null,
      58. "GroupAdd": null,
      59. "IpcMode": "",
      60. "Cgroup": "",
      61. "Links": null,
      62. "OomScoreAdj": 0,
      63. "PidMode": "",
      64. "Privileged": false,
      65. "PublishAllPorts": false,
      66. "ReadonlyRootfs": false,
      67. "SecurityOpt": null,
      68. "UTSMode": "",
      69. "UsernsMode": "",
      70. "ShmSize": 67108864,
      71. "Runtime": "docker-runc",
      72. "ConsoleSize": [
      73. 0,
      74. 0
      75. ],
      76. "Isolation": "",
      77. "CpuShares": 0,
      78. "Memory": 0,
      79. "NanoCpus": 0,
      80. "CgroupParent": "",
      81. "BlkioWeight": 0,
      82. "BlkioWeightDevice": null,
      83. "BlkioDeviceReadBps": null,
      84. "BlkioDeviceWriteBps": null,
      85. "BlkioDeviceReadIOps": null,
      86. "BlkioDeviceWriteIOps": null,
      87. "CpuPeriod": 0,
      88. "CpuQuota": 0,
      89. "CpuRealtimePeriod": 0,
      90. "CpuRealtimeRuntime": 0,
      91. "CpusetCpus": "",
      92. "CpusetMems": "",
      93. "Devices": [],
      94. "DiskQuota": 0,
      95. "KernelMemory": 0,
      96. "MemoryReservation": 0,
      97. "MemorySwap": 0,
      98. "MemorySwappiness": -1,
      99. "OomKillDisable": false,
      100. "PidsLimit": 0,
      101. "Ulimits": null,
      102. "CpuCount": 0,
      103. "CpuPercent": 0,
      104. "IOMaximumIOps": 0,
      105. "IOMaximumBandwidth": 0
      106. },
      107. "GraphDriver": {
      108. "Name": "overlay2",
      109. "Data": {
      110. "LowerDir": "/var/lib/docker/overlay2/d8d3dca6c9115b3c782bf358a744475e78f5e62b627cca79e10a34e754310933-init/diff:/var/lib/docker/overlay2/7bc85336eb8ca768f43d8eb3d5f27bdf35fa99068be45c84622d18c0f87c90bd/diff",
      111. "MergedDir": "/var/lib/docker/overlay2/d8d3dca6c9115b3c782bf358a744475e78f5e62b627cca79e10a34e754310933/merged",
      112. "UpperDir": "/var/lib/docker/overlay2/d8d3dca6c9115b3c782bf358a744475e78f5e62b627cca79e10a34e754310933/diff",
      113. "WorkDir": "/var/lib/docker/overlay2/d8d3dca6c9115b3c782bf358a744475e78f5e62b627cca79e10a34e754310933/work"
      114. }
      115. },
      116. "Mounts": [],
      117. "Config": {
      118. "Hostname": "6c4bb3ce4c35",
      119. "Domainname": "",
      120. "User": "",
      121. "AttachStdin": false,
      122. "AttachStdout": false,
      123. "AttachStderr": false,
      124. "Tty": false,
      125. "OpenStdin": false,
      126. "StdinOnce": false,
      127. "Env": [
      128. "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
      129. ],
      130. "Cmd": [
      131. "/bin/sh",
      132. "-c",
      133. "while true;do echo hello zzyy;sleep 2;done"
      134. ],
      135. "Image": "centos",
      136. "Volumes": null,
      137. "WorkingDir": "",
      138. "Entrypoint": null,
      139. "OnBuild": null,
      140. "Labels": {
      141. "org.label-schema.build-date": "20190801",
      142. "org.label-schema.license": "GPLv2",
      143. "org.label-schema.name": "CentOS Base Image",
      144. "org.label-schema.schema-version": "1.0",
      145. "org.label-schema.vendor": "CentOS"
      146. }
      147. },
      148. "NetworkSettings": {
      149. "Bridge": "",
      150. "SandboxID": "d5f116b329f01e9bab7f985282fd568e379c8e7aa4fcc3677b9b025ded771149",
      151. "HairpinMode": false,
      152. "LinkLocalIPv6Address": "",
      153. "LinkLocalIPv6PrefixLen": 0,
      154. "Ports": {},
      155. "SandboxKey": "/var/run/docker/netns/d5f116b329f0",
      156. "SecondaryIPAddresses": null,
      157. "SecondaryIPv6Addresses": null,
      158. "EndpointID": "825091555bc0adfdf32667650884ec2b6274c44c787291870de32ec2cee8575b",
      159. "Gateway": "172.17.0.1",
      160. "GlobalIPv6Address": "",
      161. "GlobalIPv6PrefixLen": 0,
      162. "IPAddress": "172.17.0.2",
      163. "IPPrefixLen": 16,
      164. "IPv6Gateway": "",
      165. "MacAddress": "02:42:ac:11:00:02",
      166. "Networks": {
      167. "bridge": {
      168. "IPAMConfig": null,
      169. "Links": null,
      170. "Aliases": null,
      171. "NetworkID": "fe000671b1b7f9a2e634f409bd33ada7bed50e818a28c1d9c8245aba67b1b625",
      172. "EndpointID": "825091555bc0adfdf32667650884ec2b6274c44c787291870de32ec2cee8575b",
      173. "Gateway": "172.17.0.1",
      174. "IPAddress": "172.17.0.2",
      175. "IPPrefixLen": 16,
      176. "IPv6Gateway": "",
      177. "GlobalIPv6Address": "",
      178. "GlobalIPv6PrefixLen": 0,
      179. "MacAddress": "02:42:ac:11:00:02"
      180. }
      181. }
      182. }
      183. }
      184. ]
      185. [root@topcheer ~]#
  • 相关阅读:
    OpenCV实战(33)——OpenCV与深度学习的碰撞
    Aqwa 带你掌握船舶与海洋工程水动力理论与工程应用
    IDEA查看类型层次结构(Type Hierarchy)
    案例:实现TodoLis(尚硅谷)
    uniapp使用request下载图片,并且显示出来
    金字塔思维
    Python数据分析之numpy的使用
    python经典小游戏:24速算(案例)
    Linux系列之进程管理
    Credo推出业界首款单片集成CMOS VCSEL驱动器的800G光DSP芯片
  • 原文地址:https://blog.csdn.net/qq_29860591/article/details/127736583