在這以前呢,也寫過兩篇關於Docker基礎入門類的文章php
Docker容器技術入門(一)html
Docker容器技術入門(二)node
不少人都感受這文章這麼簡單、這麼基礎,但是別忘記了「萬丈高樓平地起」,若是少了這個平地址,你這高樓估計也起不了。因此,基礎是學習任何一門技術或者一個技術點的重中之重,也能夠說是很關鍵的決勝點。linux
因此呢,今天,民工哥給你們總結了這20個Docker Command,願各位小夥伴在通往「玩轉Docker」路上再也不無助!!!!nginx
安裝完成docker容器服務以後,須要瞭解如何操做它?在shell命令行下直接輸入docker就能夠查看幫助信息,以下。git
[root@master ~]# docker Usage: docker COMMAND A self-sufficient runtime for containers Options: --config string Location of client config files (default "/root/.docker") -D, --debug Enable debug mode --help Print usage -H, --host list Daemon socket(s) to connect to (default []) -l, --log-level string Set the logging level ("debug", "info", "warn", "error", "fatal") (default "info") --tls Use TLS; implied by --tlsverify --tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem") --tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem") --tlskey string Path to TLS key file (default "/root/.docker/key.pem") --tlsverify Use TLS and verify the remote -v, --version Print version information and quit Management Commands: container Manage containers image Manage images network Manage networks node Manage Swarm nodes plugin Manage plugins secret Manage Docker secrets service Manage services stack Manage Docker stacks swarm Manage Swarm system Manage Docker volume Manage volumes Commands: attach Attach to a running container build Build an image from a Dockerfile commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container diff Inspect changes on a container's filesystem events Get real time events from the server exec Run a command in a running container export Export a container's filesystem as a tar archive history Show the history of an image images List images import Import the contents from a tarball to create a filesystem image info Display system-wide information inspect Return low-level information on Docker objects kill Kill one or more running containers load Load an image from a tar archive or STDIN login Log in to a Docker registry logout Log out from a Docker registry logs Fetch the logs of a container pause Pause all processes within one or more containers port List port mappings or a specific mapping for the container ps List containers pull Pull an image or a repository from a registry push Push an image or a repository to a registry rename Rename a container restart Restart one or more containers rm Remove one or more containers rmi Remove one or more images run Run a command in a new container save Save one or more images to a tar archive (streamed to STDOUT by default) search Search the Docker Hub for images start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers version Show the Docker version information wait Block until one or more containers stop, then print their exit codes
啓動/中止/重啓/殺掉容器github
實例操做以下:web
[root@docker ~]# docker start myweb [root@docker ~]# docker stop myweb [root@docker ~]# docker restart myweb [root@docker ~]# docker kill -s kill myweb
參數 -s #向容器發送信號
這些命令不作過多解釋docker
建立並啓動一個新的容器shell
經常使用參數以下: -d #後臺運行容器,並返回容器ID -i #以交互式模式運行容器,常與-t參數同時使用 -t #給容器從新分配一個僞終端,常與-i參數同時使用 --name #給容器指定一個名稱 -m #指定容器使用內存的最大值 --net #指定容器使用的網絡類型 --link #連接到另外一個容器
實例操做以下:
[root@docker ~]# docker run -d --name nginx nginx:latest #後臺啓動並運行一個名爲nginx的容器,運行前它會自動去docker鏡像站點下載最新的鏡像文件 [root@docker ~]# docker run -d -P 80:80 nginx:latest #後臺啓動並運名爲nginx的容器,而後將容器的80端口映射到物理機的80端口 [root@docker ~]# docker run -d -v /docker/data:/docker/data -P 80:80 nginx:latest #後臺啓動並運名爲nginx的容器,而後將容器的80端口映射到物理機的80端口,而且將物理機的/docker/data目錄映射到容器的/docker/data [root@docker ~]# docker run -it nginx:latest /bin/bash #以交互式模式運行容器,而後在容器內執行/bin/bash命令
刪除容器
經常使用參數以下: -f #強制刪除一個運行中的容器 -l #刪除指定的連接 -v #刪除與容器關聯和卷
實例操做以下:
[root@docker ~]# docker rm -f mydocker #強制刪除容器mydocker [root@docker ~]# docker rm -f dockerA dockerB #強制刪除容器dockerA,dockerB [root@docker ~]# docker rm -v mydocker #刪除容器,並刪除容器掛載的數據卷
建立一個新的容器但不啓動它
[root@docker ~]# docker create --name myserver nginx:latest 09b93464c2f75b7b69f83d56a9cfc23ceb50a48a9db7652ee4c27e3e2cb1961f #建立一個名爲myserver的容器
在運行的容器中執行命令
經常使用參數以下: -d #在後臺運行 -i #保持STDIN打開 -t #分配一個僞終端
實例操做以下:
[root@docker ~]# docker exec -it mydocker /bin/sh /server/scripts/docker.sh hello world!!!!!!!!!! #以交互模式執行容器中的/server/scripts/docker.sh腳本 [root@docker ~]# docker exec -it mydocker /bin/sh root@b1a0703e41e7:/# #以交互模式給容器分配一個僞終端鏈接
列出容器(正在運行)
經常使用參數以下: -a #列出全部容器包括中止的 -f #根據條件過濾顯示內容 -l #列出最近建立的容器 -n #列出最近建立的N個容器,N爲數字 -q #只顯示容器ID -s #顯示總文件大小
實例操做以下:
[root@docker ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bd96d72ed9c7 google/cadvisor "/usr/bin/cadvisor..." 47 hours ago Up 47 hours 0.0.0.0:8082->8080/tcp cadvisor 665563143eb7 grafana/grafana "/run.sh" 2 days ago Up 2 days 0.0.0.0:3000->3000/tcp grafana f2304dad5855 tutum/influxdb "/run.sh" 2 days ago Up 2 days 0.0.0.0:8083->8083/tcp, 0.0.0.0:8086->8086/tcp influxdb #列出正在運行的容器 [root@docker ~]# docker ps -n 2 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bd96d72ed9c7 google/cadvisor "/usr/bin/cadvisor..." 47 hours ago Up 47 hours 0.0.0.0:8082->8080/tcp cadvisor 665563143eb7 grafana/grafana "/run.sh" 2 days ago Up 2 days 0.0.0.0:3000->3000/tcp grafana #列出最近建立的2個容器 [root@docker ~]# docker ps -a -q bd96d72ed9c7 665563143eb7 f2304dad5855 9921d2660307 #顯示全部容器的ID
獲取容器的元數據
經常使用參數以下: -f #指定返回值格式或模板文件 -s #顯示總文件大小 --type #爲指定類型返回JSON
實例操做以下:
[root@docker ~]# docker inspect bd96d72ed9c7 [ { "Id": "bd96d72ed9c713591ba8db0ed4c0ae2689188255da71033c7bced6bb34aa8542", "Created": "2018-05-23T09:22:10.633809699Z", "Path": "/usr/bin/cadvisor", "Args": [ "-logtostderr", "-storage_driver=influxdb", "-storage_driver_db=cadvisor", "-storage_driver_host=192.168.3.82:8086" ], "State": { "Status": "running", "Running": true, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 17589, "ExitCode": 0, "Error": "", "StartedAt": "2018-05-23T09:22:10.769771142Z", "FinishedAt": "0001-01-01T00:00:00Z" }, "Image": "sha256:75f88e3ec333cbb410297e4f40297ac615e076b4a50aeeae49f287093ff01ab1", "ResolvConfPath": "/var/lib/docker/containers/bd96d72ed9c713591ba8db0ed4c0ae2689188255da71033c7bced6bb34aa8542/resolv.conf", "HostnamePath": "/var/lib/docker/containers/bd96d72ed9c713591ba8db0ed4c0ae2689188255da71033c7bced6bb34aa8542/hostname", "HostsPath": "/var/lib/docker/containers/bd96d72ed9c713591ba8db0ed4c0ae2689188255da71033c7bced6bb34aa8542/hosts", "LogPath": "", "Name": "/cadvisor", "RestartCount": 0, "Driver": "overlay2", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "ExecIDs": null, "HostConfig": { "Binds": [ "/:/rootfs,ro", "/var/run:/var/run", -------------------------------------------省略部份內容 #獲取容器ID爲bd96d72ed9c7的元數據信息 [root@docker ~]# docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cadvisor 172.17.0.3 [root@docker ~]# docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' influxdb 172.17.0.2 #獲取容器名爲influxdb\cadvisor的IP地址
獲取容器的日誌
經常使用參數以下: -f #跟蹤日誌輸出 -t #顯示時間戳 --tail #只顯示最新n條容器日誌 --since #顯示某個開始時間的全部日誌
實例操做以下:
[root@docker ~]# docker logs -f cadvisor I0523 09:22:10.794233 1 storagedriver.go:48] Using backend storage type "influxdb" I0523 09:22:10.794295 1 storagedriver.go:50] Caching stats in memory for 2m0s I0523 09:22:10.794551 1 manager.go:151] cAdvisor running in container: "/sys/fs/cgroup/cpuacct,cpu" I0523 09:22:10.810585 1 fs.go:139] Filesystem UUIDs: map[] I0523 09:22:10.810599 1 fs.go:140] Filesystem partitions: map[shm:{mountpoint:/dev/shm major:0 minor:47 fsType:tmpfs blockSize:0} overlay:{mountpoint:/ major:0 minor:46 fsType:overlay blockSize:0} tmpfs:{mountpoint:/dev major:0 minor:50 fsType:tmpfs blockSize:0} /dev/mapper/centos-root:{mountpoint:/rootfs,ro major:253 minor:0 fsType:xfs blockSize:0} /dev/sda1:{mountpoint:/rootfs,ro/boot major:8 minor:1 fsType:xfs blockSize:0} /dev/mapper/centos-home:{mountpoint:/rootfs,ro/home major:253 minor:2 fsType:xfs blockSize:0}] W0523 09:22:10.812419 1 info.go:52] Couldn't collect info from any of the files in "/etc/machine-id,/var/lib/dbus/machine-id" I0523 09:22:10.812460 1 manager.go:225] Machine: {NumCores:1 CpuFrequency:2799091 MemoryCapacity:8203235328 HugePages:[{PageSize:2048 NumPages:0}] MachineID: SystemUUID:564D5235-FED8-3630-AA2B-D65F0855D036 BootID:fd7b3fb5-e74f-4280-80cf-0a7096239619 Filesystems:[{Device:tmpfs DeviceMajor:0 DeviceMinor:50 Capacity:4101615616 Type:vfs Inodes:1001371 HasInodes:true} {Device:/dev/mapper/centos-root DeviceMajor:253 DeviceMinor:0 Capacity:140633964544 Type:vfs Inodes:68681728 HasInodes:true} {Device:/dev/sda1 DeviceMajor:8 DeviceMinor:1 Capacity:1063256064 Type:vfs Inodes:524288 HasInodes:true} {Device:/dev/mapper/centos-home DeviceMajor:253 DeviceMinor:2 Capacity:21464350720 Type:vfs Inodes:10485760 HasInodes:true} {Device:shm DeviceMajor:0 DeviceMinor:47 Capacity:67108864 Type:vfs Inodes:1001371 HasInodes:true} {Device:overlay DeviceMajor:0 DeviceMinor:46 Capacity:140633964544 Type:vfs Inodes:68681728 HasInodes:true}] DiskMap:map[253:0:{Name:dm-0 Major:253 Minor:0 Size:140660178944 Scheduler:none} 253:1:{Name:dm-1 Major:253 Minor:1 Size:8455716864 Scheduler:none} 253:2:{Name:dm-2 Major:253 Minor:2 Size:21474836480 Scheduler:none} 2:0:{Name:fd0 Major:2 Minor:0 Size:4096 Scheduler:deadline} 8:0:{Name:sda Major:8 Minor:0 Size:171798691840 Scheduler:deadline}] NetworkDevices:[{Name:eth0 MacAddress:02:42:ac:11:00:03 Speed:10000 Mtu:1500}] Topology:[{Id:0 Memory:8589467648 Cores:[{Id:0 Threads:[0] Caches:[{Size:32768 Type:Data Level:1} {Size:32768 Type:Instruction Level:1} {Size:262144 Type:Unified Level:2}]}] Caches:[{Size:26214400 Type:Unified Level:3}]}] CloudProvider:Unknown InstanceType:Unknown InstanceID:None} #跟蹤查看容器cadvisor的日誌
顯示指定容器的端口映射
實例操做以下:
[root@docker ~]# docker port cadvisor 8080/tcp -> 0.0.0.0:8082 #顯示cadvisor容器的端口映射信息
用已存在的容器從新建立一個新的鏡像
經常使用參數以下: -a #提交的鏡像做者 -c #使用Dockerfile指令來建立鏡像 -m #提交時附上說明文字 -p #在commit時,將容器暫停
實例操做以下:
[root@docker ~]# docker commit -a "mingongge" -m "add a new images" bd96d72ed9c7 newdocker_images:v1.0.0 sha256:20ee805752cb7cae660fbae89d7c6ea4a9c6372f16a6cb079ecf6c79f87ed8c9 [root@docker ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE newdocker_images v1.0.0 20ee805752cb 7 seconds ago 62.2 MB #將容器bd96d72ed9c7從新生成一個新的鏡像名爲newdocker_images
用於容器與物理主機之間拷貝文件
實例操做以下:
[root@docker ~]# docker cp /data/index.html bd96d72ed9c7:/web/ #將物理主機中的/data/index.html拷貝到容器bd96d72ed9c7:/web/目錄下 [root@docker ~]# docker cp /data/index.html bd96d72ed9c7:/web/index.php #將物理主機中的/data/index.html拷貝到容器bd96d72ed9c7:/web/目錄下並更名爲index.php [root@docker ~]# docker cp bd96d72ed9c7:/web /data/ #拷貝容器bd96d72ed9c7:/web/目錄到物理主機中的/data/目錄下
用於登陸與登出容器鏡像倉庫
docker login #登錄到一個Docker鏡像倉庫,若是未指定鏡像倉庫地址,默認爲官方倉庫 Docker Hub docker logout #登出一個Docker鏡像倉庫,若是未指定鏡像倉庫地址,默認爲官方倉庫 Docker Hub 經常使用參數以下: -u #登錄的用戶名 -p #登錄的密碼
實例操做以下:
[root@docker ~]# docker login -u username -p password Login Succeeded [root@docker ~]# docker logout Removing login credentials for https://index.docker.io/v1/ #登陸與登出默認的容器鏡像倉庫
docker pull #從鏡像倉庫中拉取或者更新指定鏡像 docker push #將本地的鏡像上傳到鏡像倉庫,要先登錄到鏡像倉庫
實例操做以下:
[root@docker ~]# docker pull nginx Using default tag: latest Trying to pull repository docker.io/library/nginx ... latest: Pulling from docker.io/library/nginx f2aa67a397c4: Already exists 3c091c23e29d: Pulling fs layer 4a99993b8636: Pulling fs layer #從鏡像倉庫中拉取或者更新指定鏡像,輸出信息如上 [root@docker ~]# docker push newdocker_images:v1.0.0 #上傳鏡像到鏡像倉庫上
顯示系統本地容器鏡像文件
經常使用參數以下: -a #列出全部的鏡像(含中間映像層,默認,過濾掉中間映像層); --digests #顯示鏡像的摘要信息; -f #顯示知足條件的鏡像; --format #指定返回值的模板文件; --no-trunc #顯示完整的鏡像信息; -q #只顯示鏡像ID。
實例操做以下:
[root@docker ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE newdocker_images v1.0.0 20ee805752cb 28 minutes ago 62.2 MB docker.io/grafana/grafana latest 4700307f41f2 9 days ago 238 MB registry.jumpserver.org/public/guacamole 1.0.0 6300349f2642 2 months ago 1.23 GB docker.io/google/cadvisor latest 75f88e3ec333 5 months ago 62.2 MB docker.io/tutum/influxdb latest c061e5808198 19 months ago 290 MB #列出本地全部的鏡像 [root@docker ~]# docker images -q 20ee805752cb 4700307f41f2 6300349f2642 75f88e3ec333 c061e5808198 #只顯示容器ID [root@docker ~]# docker images --digests REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE newdocker_images v1.0.0 <none> 20ee805752cb 32 minutes ago 62.2 MB docker.io/grafana/grafana latest sha256:364bec4a39ecbec744ea4270aae35f6554eb6f2047b3ee08f7b5f1134857c32c 4700307f41f2 9 days ago 238 MB registry.jumpserver.org/public/guacamole 1.0.0 sha256:ea862bb2e83b648701655c27900bca14b0ab7ab9d4572e716c25a816dc55307b 6300349f2642 2 months ago 1.23 GB docker.io/google/cadvisor latest sha256:9e347affc725efd3bfe95aa69362cf833aa810f84e6cb9eed1cb65c35216632a 75f88e3ec333 5 months ago 62.2 MB docker.io/tutum/influxdb latest sha256:5b7c5e318303ad059f3d1a73d084c12cb39ae4f35f7391b79b0ff2c0ba45304b c061e5808198 19 months ago 290 MB [root@docker ~]# docker images --no-trunc REPOSITORY TAG IMAGE ID CREATED SIZE newdocker_images v1.0.0 sha256:20ee805752cb7cae660fbae89d7c6ea4a9c6372f16a6cb079ecf6c79f87ed8c9 32 minutes ago 62.2 MB docker.io/grafana/grafana latest sha256:4700307f41f249630f6d772638ad8d32c7d7e3ec86c324d449d5e21076991bb7 9 days ago 238 MB registry.jumpserver.org/public/guacamole 1.0.0 sha256:6300349f264218e783cd2bd6f7863d356ac8d5ac05a62584cb4680af7ebec292 2 months ago 1.23 GB docker.io/google/cadvisor latest sha256:75f88e3ec333cbb410297e4f40297ac615e076b4a50aeeae49f287093ff01ab1 5 months ago 62.2 MB docker.io/tutum/influxdb latest sha256:c061e580819875fad91910841fd3fc53893524bbb9326a68b2470861633aebb1 19 months ago 290 MB #能夠對比下兩個參數顯示的不一樣信息
刪除鏡像
經常使用參數以下: -f #強制刪除
實例操做以下:
[root@docker ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE newdocker_images v1.1.0 858cbd9ba687 6 seconds ago 62.2 MB newdocker_images v1.0.0 20ee805752cb 36 minutes ago 62.2 MB docker.io/grafana/grafana latest 4700307f41f2 9 days ago 238 MB registry.jumpserver.org/public/guacamole 1.0.0 6300349f2642 2 months ago 1.23 GB docker.io/google/cadvisor latest 75f88e3ec333 5 months ago 62.2 MB docker.io/tutum/influxdb latest c061e5808198 19 months ago 290 MB [root@docker ~]# docker rmi 20ee805752cb Untagged: newdocker_images:v1.0.0 Deleted: sha256:20ee805752cb7cae660fbae89d7c6ea4a9c6372f16a6cb079ecf6c79f87ed8c9 [root@docker ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE newdocker_images v1.1.0 858cbd9ba687 39 seconds ago 62.2 MB docker.io/grafana/grafana latest 4700307f41f2 9 days ago 238 MB registry.jumpserver.org/public/guacamole 1.0.0 6300349f2642 2 months ago 1.23 GB docker.io/google/cadvisor latest 75f88e3ec333 5 months ago 62.2 MB docker.io/tutum/influxdb latest c061e5808198 19 months ago 290 MB #刪除一個鏡像
標記本地鏡像
實例操做以下:
[root@docker ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE newdocker_images v1.1.0 858cbd9ba687 39 seconds ago 62.2 MB [root@docker ~]# docker tag newdocker_images:v1.1.0 newdocker_images:v2 [root@docker ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE newdocker_images v1.1.0 858cbd9ba687 4 minutes ago 62.2 MB newdocker_images v2 858cbd9ba687 4 minutes ago 62.2 MB #從結果能夠看出兩個容器的ID是同樣的,只是TAG改變了,相似於linux中文件與文件的硬連接同樣,其二者的inode號相同。
使用Dockerfile建立鏡像
經常使用參數以下: -f #指定要使用的Dockerfile路徑 --label=[] #設置鏡像使用的元數據; -m #設置內存最大值 --memory-swap #設置Swap的最大值爲內存+swap,"-1"表示不限swap --no-cache #建立鏡像的過程不使用緩存 --pull #嘗試去更新鏡像的新版本 -q #安靜模式,成功後只輸出鏡像ID --rm #設置鏡像成功後刪除中間容器 --ulimit #Ulimit配置
實例操做以下:
[root@docker ~]# docker build https://github.com/nginxinc/docker-nginx/
查看指定鏡像的建立歷史
經常使用參數以下: -H #以可讀的格式打印鏡像大小和日期,默認爲true; --no-trunc #顯示完整的提交記錄; -q #僅列出提交記錄ID。
實例操做以下:
[root@docker ~]# docker history newdocker_images:v2 IMAGE CREATED CREATED BY SIZE COMMENT 858cbd9ba687 32 minutes ago -storage_driver=influxdb -storage_driver_d... 0 B add new images 75f88e3ec333 5 months ago /bin/sh -c #(nop) ENTRYPOINT ["/usr/bin/c... 0 B <missing> 5 months ago /bin/sh -c #(nop) EXPOSE 8080/tcp 0 B <missing> 5 months ago /bin/sh -c #(nop) ADD file:e138bb5c0c12107... 26.5 MB <missing> 5 months ago /bin/sh -c apk --no-cache add ca-certifica... 30.9 MB <missing> 5 months ago /bin/sh -c #(nop) ENV GLIBC_VERSION=2.23-r3 0 B <missing> 5 months ago /bin/sh -c #(nop) MAINTAINER dengnan@goog... 0 B <missing> 5 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0 B <missing> 5 months ago /bin/sh -c #(nop) ADD file:c05a199f603e2a9... 4.82 MB
顯示 Docker 系統信息,包括鏡像和容器數
實例操做以下:
[root@docker ~]# docker info Containers: 4 Running: 3 Paused: 0 Stopped: 1 Images: 5 Server Version: 1.13.1 Storage Driver: overlay2 Backing Filesystem: xfs Supports d_type: true Native Overlay Diff: true Logging Driver: journald Cgroup Driver: systemd Plugins: Volume: local Network: bridge host macvlan null overlay Swarm: inactive Runtimes: docker-runc runc Default Runtime: docker-runc Init Binary: /usr/libexec/docker/docker-init-current containerd version: (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1) runc version: e9c345b3f906d5dc5e8100b05ce37073a811c74a (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f) init version: 5b117de7f824f3d3825737cf09581645abbe35d4 (expected: 949e6facb77383876aeff8a6944dde66b3089574) Security Options: seccomp WARNING: You're not using the default seccomp profile Profile: /etc/docker/seccomp.json Kernel Version: 3.10.0-693.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 Number of Docker Hooks: 3 CPUs: 1 Total Memory: 7.64 GiB Name: docker ID: K7N6:CHF5:KAZP:QFDB:VYBP:IWMW:7VMV:L4TB:OJD2:SEZI:YRRR:4TJN Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-ip6tables is disabled Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Registries: docker.io (secure)
顯示 Docker 版本信息
實例操做以下:
[root@docker ~]# docker version Client: Version: 1.13.1 API version: 1.26 Package version: docker-1.13.1-63.git94f4240.el7.centos.x86_64 Go version: go1.9.4 Git commit: 94f4240/1.13.1 Built: Fri May 18 15:44:33 2018 OS/Arch: linux/amd64 Server: Version: 1.13.1 API version: 1.26 (minimum version 1.12) Package version: docker-1.13.1-63.git94f4240.el7.centos.x86_64 Go version: go1.9.4 Git commit: 94f4240/1.13.1 Built: Fri May 18 15:44:33 2018 OS/Arch: linux/amd64 Experimental: false
更多精彩乾貨請關注民工哥我的微信公衆號:民工哥技術之路