使用命令:
docker inspect mysqlserver_57
查询结果
[
{
"Id": "63274d9ac59beb2e420ccc944ea594198dec7f78a50a9e4465b7b18977457e17",
"Created": "2019-10-22T01:30:01.106585536Z",
"Path": "docker-entrypoint.sh",
"Args": [
"--lower_case_table_names=1"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 15461,
"ExitCode": 0,
"Error": "",
"StartedAt": "2019-10-22T01:30:01.397016179Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:c8ee894bd2bd30f1c5758baf1c4cf2bd49ff7161b29ae404a8562b523fc3f642",
"ResolvConfPath": "/var/lib/docker/containers/63274d9ac59beb2e420ccc944ea594198dec7f78a50a9e4465b7b18977457e17/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/63274d9ac59beb2e420ccc944ea594198dec7f78a50a9e4465b7b18977457e17/hostname",
"HostsPath": "/var/lib/docker/containers/63274d9ac59beb2e420ccc944ea594198dec7f78a50a9e4465b7b18977457e17/hosts",
"LogPath": "",
"Name": "/mysqlserver_57",
"RestartCount": 0,
"Driver": "overlay2",
"MountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c159,c841",
"ProcessLabel": "system_u:system_r:svirt_lxc_net_t:s0:c159,c841",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "journald",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"3306/tcp": [
{
"HostIp": "",
"HostPort": "3306"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "docker-runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Name": "overlay2",
"Data": {
"LowerDir": "/var/lib/docker/overlay2/d6214bf59f9cedf86e0765084d7e99a449cdf5a515c3c3ca5120ca5bc5d901c9-init/diff:/var/lib/docker/overlay2/00569a3e9c79a11e1125ac6b1c7a19aed962518ad9734713d3554b3ca5f2a949/diff:/var/lib/docker/overlay2/4a94d1afc4b0fc50b94717c595f874db68b2ebed14426ca835963e6c80960a68/diff:/var/lib/docker/overlay2/e3cad079bf343d67e2e52a1b50e6fedd7dffb981c6452646b12e55fa5f300955/diff:/var/lib/docker/overlay2/9575cc4daf0824a997c9774e1aa03fc43275dba0b62129a666a4e30f42758c66/diff:/var/lib/docker/overlay2/fa66966e84417e58e4dda8e83874a51e8926f0ed5e80a9c51f64dba0d812ec33/diff:/var/lib/docker/overlay2/69265d0ddc79e45d5cf928cdd8eed69f7c16095915a183bbef073dab59cb6b4d/diff:/var/lib/docker/overlay2/5283d6e8f8870fa6a4ccca594e3c64dba7f5ace8f4fc7c7d28745ce3deb14aa3/diff:/var/lib/docker/overlay2/fe12377a789d2f677c6ef648fc473a5c8b57f84935b579e89675eb8a711b45b5/diff:/var/lib/docker/overlay2/9c82014288c2f681ae459499565ab008ea8f74581aa891f0fb2135fc3a32d37a/diff:/var/lib/docker/overlay2/a2cedebc642044ed082ab869a0160e448b4082eae55cc86ffc9fc09f05bf578d/diff:/var/lib/docker/overlay2/817b91a8f469c8802c65c69f46945fe83fbbb5258cdd63efc8856391882c4b73/diff:/var/lib/docker/overlay2/b5ecc0e0402631dd2d359ea2617644242edbe2e208ef99eaf5f62a8bdfa696f9/diff",
"MergedDir": "/var/lib/docker/overlay2/d6214bf59f9cedf86e0765084d7e99a449cdf5a515c3c3ca5120ca5bc5d901c9/merged",
"UpperDir": "/var/lib/docker/overlay2/d6214bf59f9cedf86e0765084d7e99a449cdf5a515c3c3ca5120ca5bc5d901c9/diff",
"WorkDir": "/var/lib/docker/overlay2/d6214bf59f9cedf86e0765084d7e99a449cdf5a515c3c3ca5120ca5bc5d901c9/work"
}
},
"Mounts": [
{
"Type": "volume",
"Name": "e37af70f2268955ca07d621483190b76044dd14f5ac53e2c5abe8081f1776326",
"Source": "/var/lib/docker/volumes/e37af70f2268955ca07d621483190b76044dd14f5ac53e2c5abe8081f1776326/_data",
"Destination": "/var/lib/mysql",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "63274d9ac59b",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {},
"33060/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"MYSQL_ROOT_PASSWORD=123456",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=8.0",
"MYSQL_VERSION=8.0.18-1debian9"
],
"Cmd": [
"--lower_case_table_names=1"
],
"Image": "mysql",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "6462ee802ea3bed9d5b724c44f32a341740b7531f3dbdf71048fca55eff9f788",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3306/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "3306"
}
],
"33060/tcp": null
},
"SandboxKey": "/var/run/docker/netns/6462ee802ea3",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "f28525b4e04e984ccfe5f121666edb3ab837eacebb9357c3d0fe7c5c44bb42f5",
"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": "659b639040856cf579cab68354c31b4d4f607a3674e31acfe8d20edee87fbd6d",
"EndpointID": "f28525b4e04e984ccfe5f121666edb3ab837eacebb9357c3d0fe7c5c44bb42f5",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02"
}
}
}
}
]
IPAddress就是mysql的ip地址
"IPAddress": "172.17.0.2",