1 查看 docker 版本信息
root@rocky8 ~]$ docker version Client: Docker Engine - Community Version: 19.03.15 API version: 1.40 Go version: go1.13.15 Git commit: 99e3ed8919 Built: Sat Jan 30 03:16:44 2021 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.15 API version: 1.40 (minimum version 1.12) Go version: go1.13.15 Git commit: 99e3ed8919 Built: Sat Jan 30 03:15:19 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.15 GitCommit: 5b842e528e99d4d4c1686467debf2bd4b88ecd86 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.18.0 GitCommit: fec36832 查看 docker 详解信息
[root@ubuntu1804 ~]$ docker info Client: Debug Mode: false #client 端是否开启 debug Server: Containers: 2 #当前主机运行的容器总数 Running: 0 #有几个容器是正在运行的 Paused: 0 #有几个容器是暂停的 Stopped: 2 #有几个容器是停止的 Images: 4 #当前服务器的镜像数 Server Version: 19.03.5 #服务端版本 Storage Driver: overlay2 #正在使用的存储引擎 Backing Filesystem: extfs #后端文件系统,即服务器的磁盘文件系统 Supports d_type: true #是否支持 d_type Native Overlay Diff: true #是否支持差异数据存储 Logging Driver: json-file #日志类型 Cgroup Driver: cgroupfs #Cgroups 类型 Plugins: #插件 Volume: local #卷 Network: bridge host ipvlan macvlan null overlay # overlay 跨主机通信 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog # 日志类型 Swarm: inactive #是否支持 swarm Runtimes: runc #已安装的容器运行时 Default Runtime: runc #默认使用的容器运行时 Init Binary: docker-init #初始化容器的守护进程,即 pid 为 1 的进程 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339 #版本 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 #runc 版本 init version: fec3683 #init 版本 Security Options: #安全选项 apparmor #安全模块,https://docs.docker.com/engine/security/apparmor/ seccomp #安全计算模块,即制容器操作,https://docs.docker.com/engine/security/seccomp/ Profile: default #默认的配置文件 Kernel Version: 4.15.0-29-generic #宿主机内核版本 Operating System: Ubuntu 18.04.1 LTS #宿主机操作系统 OSType: linux #宿主机操作系统类型 Architecture: x86_64 #宿主机架构 CPUs: 1 #宿主机 CPU 数量 Total Memory: 962MiB #宿主机总内存 Name: ubuntu1804.wang.org #宿主机 hostname ID: IZHJ:WPIN:BRMC:XQUI:VVVR:UVGK:NZBM:YQXT:JDWB:33RS:45V7:SQWJ #宿主机 ID Docker Root Dir: /var/lib/docker #宿主机关于docker数据的保存目录 Debug Mode: false #server 端是否开启 debug Registry: https://index.docker.io/v1/ #仓库路径 Labels: Experimental: false #是否测试版 Insecure Registries: 127.0.0.0/8 : #非安全的镜像仓库 Registry Mirrors: https://si7y70hh.mirror.aliyuncs.com/ #镜像仓库 Live Restore Enabled: false #是否开启活动重启 (重启docker-daemon 不关闭容器 ) WARNING: No swap limit support #系统警告信息 (没有开启 swap 资源限制 )范例: 解决上述SWAP报警提示
[root@ubuntu1804 ~]# vim /etc/default/grub GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=hidden GRUB_TIMEOUT=2 GRUB_DISTRIBUTOR=`lsb_ release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="" GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 swapaccount=1" #修改此行 [root@ubuntu1804 ~]# update-grub [root@ubuntu1804 ~]# reboot
小结 :
本文主要讲解了docker中查看docker版本信息和详细信息的命令,并给出了在查看详细信息时出现SWAP报警提示的解决方案,希望对大家学习docker有所帮助。