现在的java开发人员真的是太难了,之前需要学习前端做全栈,如今还需要会架构和懂些运维的知识了,也就是DevOps(开发及运维),引用B站狂神老师说的一句话就是只要学不死,就往死里学!!!现在给大家分享下从狂神老师那里学来的Docker中的知识梳理(学习阶段我是在windows上面操作的)。
Docker与传统虚拟机有什么不同:
1.传统虚拟机需要虚拟出一整个操作系统,而Docker是直接运行在宿主机上的。
2.Docker的每个容器中都有自己的文件系统,互不影响。
Docker的优点
1.应用更快的交付和部署
2.更便捷的升级和扩缩容
3.更简单的系统运维
4.更高效的计算资源利用
1.镜像(Image):Docker 镜像(Image),就相当于是一个 root 文件系统。比如官方镜像 ubuntu:16.04 就包含了完整的一套 Ubuntu16.04 最小系统的 root 文件系统。
2.容器(Container):镜像(Image)和容器(Container)的关系,就像是面向对象程序设计中的类和实例一样,镜像是静态的定义,容器是镜像运行时的实体。容器可以被创建、启动、停止、删除、暂停等。
3.仓库(Repository):仓库可看成一个代码控制中心,用来保存镜像。
1.进入Docker官网https://docs.docker.com/
2.点击Download and install
3.侧边栏找到Get Docker,然后我这边选择的Windows版本的
4.下载Docker Desktop Installer.exe
由于Docker下载镜像默认是在国外比较慢,所以我们可以配置阿里云镜像加快下载速度,这点就跟Maven差不多。https://xxxxxx.mirror.aliyuncs.com这个需要换成自己的地址。获取方式https://blog.csdn.net/sinat_32247833/article/details/79767263
{
"debug": true,
"experimental": false,
"registry-mirrors": [
"https://xxxxxx.mirror.aliyuncs.com",
"http://hub-mirror.c.163.com"
]
}
官方命令文档:https://docs.docker.com/reference/
docker images
PS C:\Users\ASUS> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql latest ecac195d15af 4 weeks ago 516MB
redis latest 7faaec683238 5 weeks ago 113MB
centos latest 5d0da3dc9764 2 months ago 231MB
kibana latest a674d23325b0 3 years ago 388MB
elasticsearch latest 5acf0e8da90b 3 years ago 486MB
docker search [镜像名]
PS C:\Users\ASUS> docker search mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 11686 [OK]
mariadb MariaDB Server is a high performing open sou… 4452 [OK]
mysql/mysql-server Optimized MySQL Server Docker images. Create… 868 [OK]
percona Percona Server is a fork of the MySQL relati… 561 [OK]
phpmyadmin phpMyAdmin - A web interface for MySQL and M… 371 [OK]
centos/mysql-57-centos7 MySQL 5.7 SQL database server 91
mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr… 89
centurylink/mysql Image containing mysql. Optimized to be link… 59 [OK]
databack/mysql-backup Back up mysql databases to... anywhere! 52
prom/mysqld-exporter 43 [OK]
deitch/mysql-backup REPLACED! Please use http://hub.docker.com/r… 41 [OK]
tutum/mysql Base docker image to run a MySQL database se… 35
linuxserver/mysql A Mysql container, brought to you by LinuxSe… 34
schickling/mysql-backup-s3 Backup MySQL to S3 (supports periodic backup… 31 [OK]
mysql/mysql-router MySQL Router provides transparent routing be… 23
centos/mysql-56-centos7 MySQL 5.6 SQL database server 20
arey/mysql-client Run a MySQL client from a docker container 19 [OK]
fradelg/mysql-cron-backup MySQL/MariaDB database backup using cron tas… 16 [OK]
openshift/mysql-55-centos7 DEPRECATED: A Centos7 based MySQL v5.5 image… 6
ansibleplaybookbundle/mysql-apb An APB which deploys RHSCL MySQL 3 [OK]
devilbox/mysql Retagged MySQL, MariaDB and PerconaDB offici… 3
idoall/mysql MySQL is a widely used, open-source relation… 3 [OK]
jelastic/mysql An image of the MySQL database server mainta… 2
centos/mysql-80-centos7 MySQL 8.0 SQL database server 1
widdpim/mysql-client Dockerized MySQL Client (5.7) including Curl… 1 [OK]
docker pull [镜像名][:版本号]
PS C:\Users\ASUS> docker pull kibana
Using default tag: latest
latest: Pulling from library/kibana
f189db1b88b3: Pull complete
8e4c00d0a2f1: Pull complete
ae50ad228104: Pull complete
228a7a369ee9: Pull complete
5272eb2224c2: Pull complete
b0a91590498c: Pull complete
4b8a31943945: Pull complete
df84b481e461: Pull complete
0863f2e045e0: Pull complete
Digest: sha256:8b3ea5e4974be2e916d5a5e7fbe2bd3a8f229c374525361372192736459083f9
Status: Downloaded newer image for kibana:latest
docker.io/library/kibana:latest
docker rmi -f [镜像名] || [镜像id]
PS C:\Users\ASUS> docker rmi -f kibana
Untagged: kibana:latest
Untagged: kibana@sha256:8b3ea5e4974be2e916d5a5e7fbe2bd3a8f229c374525361372192736459083f9
Deleted: sha256:a674d23325b02611f19c1dc1fa73d9e4570d06cb8701cfb0350db3d24f9d0113
Deleted: sha256:21e8a7f26865db255c09b005c2c552d5761933f78ccaed182d213e4186fa8546
Deleted: sha256:b99918d3b00a638b6f901eca66c47a673c941c903e62a14c98cfbd9c6e0fb794
Deleted: sha256:86fc0bdb6ac014769f0cbf760839f31209a3aa3b6818a9c97a93dbcfb9693d5c
Deleted: sha256:2c9d66820273235afc234b027f88944ce4f287d55a3e7565b528b7cc781958de
Deleted: sha256:c908d693f2f114f4d2950ba54f45554ee51df008c1cdc35fc8bb1831d03c5887
Deleted: sha256:ff560d56ba1533338d1fa11e6f030f061d02e5ada6db7329cfe8d4f1c7bf8e8b
Deleted: sha256:8a5478d8668717b59584bfb55b52856a5b1f5f73a35966e19d69945d2f2960ea
Deleted: sha256:e6e9f204fabbec051641de49fae8f8a5a9c07e071cea3692764391f2263972ea
Deleted: sha256:8c466bf4ca6ffdda8b7717b1cd6fe31109529ee64e626a003a224fb8bd2bc469
docker rmi -f $(docker images -aq)
PS C:\Users\ASUS> docker rmi -f $(docker images -aq)
Untagged: mysql:latest
Untagged: mysql@sha256:6d7d4524463fe6e2b893ffc2b89543c81dec7ef82fb2020a1b27606666464d87
Deleted: sha256:ecac195d15afac2335de52fd7a0e34202fe582731963d31830f1b97700bf9509
Deleted: sha256:451fe04d80b84c0b7aca0f0bbdaa5de7c7ac85a65389ed5d3ed492f63ac092e2
Deleted: sha256:814cbf8bc7f6bb85685e5b803e16a76406c30d1960c566eee76303ffac600600
Deleted: sha256:735f72e1d1b936bb641b6a1283e4e60bf10a0c36f8244a5e3f8c7d58fa95b98a
Deleted: sha256:f2d209a30c3950fadffb2d82e1faa434da0753bee7aacad9cdec7d8a7a83df37
Deleted: sha256:03b9f8c5331d9534d2372a144bcffc8402e5f7972c9e4b85c634bef203ec6d20
Deleted: sha256:80f5487a88b8061855e99782979ed6069a8dd1c7dfbb1eb63fe42a4a9d119436
Deleted: sha256:f791a6c727931d41c51f8bf24ee32a4dbf0169f372b174f1ff89b4836b97c48e
Deleted: sha256:4c88df098412e11a98936509f3cede57f87154b350b0f75d96713f6e1dd56101
Deleted: sha256:fdba3a2cd286d9a5f65fc00f5254048855ae7dc00f3b3fa3356981eb9a7fe6d0
Deleted: sha256:8b3a69042e0da82429d28be0c474e73290ba4908730de22b2200a7aac9b245bd
Deleted: sha256:90afe56a0643f5bf1b1e8ee147b40a8e12b3fdd7e26bc2d2c50180d68dd524d0
Deleted: sha256:e81bff2725dbc0bf2003db10272fef362e882eb96353055778a66cda430cf81b
Untagged: redis:latest
Untagged: redis@sha256:54ee15a0b0d2c661d46b9bfbf55b181f9a4e7ddf8bf693eec5703dac2c0f5546
Deleted: sha256:7faaec68323851b2265bddb239bd9476c7d4e4335e9fd88cbfcc1df374dded2f
Deleted: sha256:e6deb90762475cda72e21895911f830ed99fd1cc6d920d92873270be91235274
Deleted: sha256:2649acad13241d9c8d81e49357bc66cce459b352ded7f423d70ede7bd3bb7b89
Deleted: sha256:64007bba5fc220df4d3da33cecdc2d55dd6a73528c138b0fa1acd79fd6a9c217
Deleted: sha256:b2cc2f1bf8b1cca8ba7c19e1697f7b73755903ad8f880b83673fd6a697aca935
Deleted: sha256:fbd1283ab782925be4d990bd4bebe9ad5e5cf9a525abfb6fa87465e072da9d31
Deleted: sha256:e8b689711f21f9301c40bf2131ce1a1905c3aa09def1de5ec43cf0adf652576e
Untagged: centos:latest
Untagged: centos@sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177
Deleted: sha256:5d0da3dc976460b72c77d94c8a1ad043720b0416bfc16c52c45d4847e53fadb6
Deleted: sha256:74ddd0ec08fa43d09f32636ba91a0a3053b02cb4627c35051aff89f853606b59
Untagged: elasticsearch:latest
Untagged: elasticsearch@sha256:a8081d995ef3443dc6d077093172a5931e02cdb8ffddbf05c67e01d348a9770e
Deleted: sha256:5acf0e8da90b995bace9fdc8f12c02ba323441873a509c19258ce0afa6754d0b
Deleted: sha256:66c749d879b8f40691241aca69d87717e54b6be68ec73208d9a44b533f9204f7
Deleted: sha256:8a53ac29c9bef5f702cb3324c53f13997067674706188805084499bbea6a7825
Deleted: sha256:2ca0bc84de8539404abd6acca448b3d14e6c8fefbfb15bcfc43e123efbe329ad
Deleted: sha256:a1cb23c8850af10cde5b351bfec97c402d57bfbf78169c520d69642139528fbc
Deleted: sha256:374b29a54b5a6a91d9e647eed0230b75654ed55ae719014c38faf3dc27d03472
Deleted: sha256:1ccc05345091bb39b170180859e4312e43432e1694ce1964e0fb4fc3548d4fd2
Deleted: sha256:3ffda1330d17210a51b1e69f385339369edae86f2b481e3418756c853fff85f2
Deleted: sha256:eb25282c86a6f048cf9c766b6456d074ce22952ace1573d090852e460d448a91
Deleted: sha256:ace97896118c74c99d4555445966e9e16b7e7f7670fde53d33d9753b84f4247f
Deleted: sha256:a9de2214d67d0d7bf40e88e646bb75e3a95cd21c614121449c2873ab4236f41c
Deleted: sha256:0e3c6dece00c9e96b98787480de7c821a1cf7a7ac33883e0b6a386c2b22d285f
Deleted: sha256:be985ef6c5ce96739cbe924702dc83fa1c05b0635178cf939985ead10ca4177f
Deleted: sha256:54a32bd7a949afcfc50488df9a48db13f5bfc63c282a09db4aa2fb499012c21f
Deleted: sha256:7d5f2843cac2368781293d71139c6c30fbb6b7029f6fd4424da858e7f2772875
Deleted: sha256:b28ef0b6fef80faa25436bec0a1375214d9a23a91e9b75975bba3b2889f8504f
docker run [可选参数] [镜像名]
可选参数
1.- -name=“Name” 设置容器名称
2.-d 后台方式运行
3.-it 以交互的方式运行,进入容器查看内容
4.-p 指定容器的端口号
-p ip:主机端口:容器端口
-p 主机端口:容器端口(常用)
-p 容器端口
5.-P 随机指定端口
PS C:\Users\ASUS> docker run -it centos /bin/bash
[root@a1de24fa18d8 /]#
docker ps
PS C:\Users\ASUS> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f02319bdaad redis:latest "docker-entrypoint.s…" 9 seconds ago Up 8 seconds 0.0.0.0:6379->6379/tcp dockerRedis
docker ps -a
PS C:\Users\ASUS> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ac171483af30 redis:latest "docker-entrypoint.s…" 13 seconds ago Exited (0) 6 seconds ago dockerRedis
docker logs -f -t --tail 10 [容器id]|[容器名]
PS C:\Users\ASUS> docker logs -f -t --tail 10 a248a9070f15
docker top [容器id]|[容器名]
PS C:\Users\ASUS> docker top a248a9070f15
UID PID PPID C STIME TTY TIME CMD
root 2266 2246 0 03:18 ? 00:00:00 /bin/bash
docker inspect [容器id]|[容器名]
PS C:\Users\ASUS> docker inspect a248a9070f15
[
{
"Id": "a248a9070f15c6f1851975f8e166bbfa82fafd918757247a4f017aa8ef7f3f93",
"Created": "2021-11-22T03:18:01.2602056Z",
"Path": "/bin/bash",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 2266,
"ExitCode": 0,
"Error": "",
"StartedAt": "2021-11-22T03:18:01.873066Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:5d0da3dc976460b72c77d94c8a1ad043720b0416bfc16c52c45d4847e53fadb6",
"ResolvConfPath": "/var/lib/docker/containers/a248a9070f15c6f1851975f8e166bbfa82fafd918757247a4f017aa8ef7f3f93/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/a248a9070f15c6f1851975f8e166bbfa82fafd918757247a4f017aa8ef7f3f93/hostname",
"HostsPath": "/var/lib/docker/containers/a248a9070f15c6f1851975f8e166bbfa82fafd918757247a4f017aa8ef7f3f93/hosts",
"LogPath": "/var/lib/docker/containers/a248a9070f15c6f1851975f8e166bbfa82fafd918757247a4f017aa8ef7f3f93/a248a9070f15c6f1851975f8e166bbfa82fafd918757247a4f017aa8ef7f3f93-json.log",
"Name": "/beautiful_davinci",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
50,
150
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/91cd0c2db40fe24d9a552532230bb3515352b726a7ee8318c1da7c7efc2fbb10-init/diff:/var/lib/docker/overlay2/b483d337fa0da6db777faa2964151199c9401b045bf3c29d40c830fb5fdef314/diff",
"MergedDir": "/var/lib/docker/overlay2/91cd0c2db40fe24d9a552532230bb3515352b726a7ee8318c1da7c7efc2fbb10/merged",
"UpperDir": "/var/lib/docker/overlay2/91cd0c2db40fe24d9a552532230bb3515352b726a7ee8318c1da7c7efc2fbb10/diff",
"WorkDir": "/var/lib/docker/overlay2/91cd0c2db40fe24d9a552532230bb3515352b726a7ee8318c1da7c7efc2fbb10/work"
},
"Name": "overlay2"
},
"Mounts": [],
"Config": {
"Hostname": "a248a9070f15",
"Domainname": "",
"User": "",
"AttachStdin": true,
"AttachStdout": true,
"AttachStderr": true,
"Tty": true,
"OpenStdin": true,
"StdinOnce": true,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/bash"
],
"Image": "centos",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"org.label-schema.build-date": "20210915",
"org.label-schema.license": "GPLv2",
"org.label-schema.name": "CentOS Base Image",
"org.label-schema.schema-version": "1.0",
"org.label-schema.vendor": "CentOS"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "00901479ebea774da7e7819b00fbd5718767bbf2373b18c5e741926c16b81520",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/00901479ebea",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "8b0f0677bfdcb71f4073c7a7d2140a1c4dbd3fa9b1f6f1f5bf0e52d749ce3b0f",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "5b61a0421ea67879ce8ffe9fa7efd2b6661e8d4b04b4c3e222e290fa731a599a",
"EndpointID": "8b0f0677bfdcb71f4073c7a7d2140a1c4dbd3fa9b1f6f1f5bf0e52d749ce3b0f",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
]
docker exec -it [容器id]|[容器名] bashShell
PS C:\Users\ASUS> docker exec -it a248a9070f15 /bin/bash
[root@a248a9070f15 /]# ls
bin dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var
[root@a248a9070f15 /]# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 03:18 pts/0 00:00:00 /bin/bash
root 15 0 0 08:09 pts/1 00:00:00 /bin/bash
root 30 15 0 08:09 pts/1 00:00:00 ps -ef
docker attach [容器id]|[容器名]
PS C:\Users\ASUS> docker attach a248a9070f15
[root@a248a9070f15 /]#
docker cp [容器id]:容器内路径 目标主机路径
PS C:\Users\ASUS> docker run -it centos /bin/bash
[root@b2f5c8ecd24b /]#
PS C:\Users\ASUS> cd /home
PS C:\home> ls
目录: C:\home
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2021/11/22 16:39 0 test.java
PS C:\home> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b2f5c8ecd24b centos "/bin/bash" 30 seconds ago Up 29 seconds nice_elbakyan
PS C:\home> docker attach b2f5c8ecd24b
[root@b2f5c8ecd24b /]# cd /home
[root@b2f5c8ecd24b home]# ls
[root@b2f5c8ecd24b home]# touch test.java
[root@b2f5c8ecd24b home]# exit
exit
PS C:\home> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
PS C:\home> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b2f5c8ecd24b centos "/bin/bash" 2 minutes ago Exited (0) 47 seconds ago nice_elbakyan
PS C:\home> docker cp b2f5c8ecd24b:/home/test.java /home
PS C:\home> ls
目录: C:\home
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2021/11/22 16:51 0 test.java
exit
PS C:\Users\ASUS> docker run -it centos /bin/bash
[root@2076dd4dd43b /]# exit
exit
Ctrl+P+Q
PS C:\Users\ASUS> docker run -it centos /bin/bash
[root@a0a67851aece /]#
PS C:\Users\ASUS>
docker rm [容器id]||[容器名]
PS C:\Users\ASUS> docker rm dockerRedis
dockerRedis
docker rm -f $(docker ps -aq)
PS C:\Users\ASUS> docker rm -f $(docker ps -aq)
a0a67851aece
2076dd4dd43b
docker start [容器id]|[容器名]
PS C:\Users\ASUS> docker start elegant_perlman
elegant_perlman
docker restart [容器id]|[容器名]
PS C:\Users\ASUS> docker restart elegant_perlman
elegant_perlman
docker stop [容器id]|[容器名]
PS C:\Users\ASUS> docker stop elegant_perlman
elegant_perlman
docker kill [容器id]|[容器名]
PS C:\Users\ASUS> docker kill elegant_perlman
elegant_perlman
docker version
PS C:\Users\ASUS> docker version
Client:
Cloud integration: v1.0.20
Version: 20.10.10
API version: 1.41
Go version: go1.16.9
Git commit: b485636
Built: Mon Oct 25 07:47:53 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.10
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: e2f740d
Built: Mon Oct 25 07:41:30 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
PS C:\Users\ASUS> docker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Build with BuildKit (Docker Inc., v0.6.3)
compose: Docker Compose (Docker Inc., v2.1.1)
scan: Docker Scan (Docker Inc., 0.9.0)
Server:
Containers: 5
Running: 0
Paused: 0
Stopped: 5
Images: 5
Server Version: 20.10.10
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc version: v1.0.2-0-g52b36a2
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 5.10.16.3-microsoft-standard-WSL2
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 12.35GiB
Name: docker-desktop
ID: HOLJ:RUSV:ZVZV:LAPU:TN5P:Y6XW:AT7Z:LK6H:VWCZ:ZFPK:K3E5:C5WG
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 42
Goroutines: 43
System Time: 2021-11-16T09:07:40.3106784Z
EventsListeners: 3
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Registry Mirrors:
https://018e61ce.mirror.aliyuncs.com/
Live Restore Enabled: false
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
docker 命令 --help
PS C:\Users\ASUS> docker version --help
Show the Docker version information
Usage:
docker version [flags]
Flags:
-f, --format string Format the output. Values: [pretty | json]. (Default: pretty)
-h, --help Help for version
--kubeconfig string Kubernetes config file
docker stats
PS C:\Users\ASUS> docker stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.01% 417.8MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.47% 417.8MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.47% 417.8MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 1.59% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 1.59% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 1.59% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.58% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.58% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.51% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.51% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.25% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.25% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.47% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
09ddc5cc26bb es 0.47% 417.7MiB / 12.35GiB 3.30% 836B / 0B 0B / 0B 50