docker 查看mysql的镜像的ip地址

使用命令:

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",
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 206,839评论 6 482
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 88,543评论 2 382
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 153,116评论 0 344
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 55,371评论 1 279
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 64,384评论 5 374
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,111评论 1 285
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,416评论 3 400
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,053评论 0 259
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,558评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,007评论 2 325
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,117评论 1 334
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,756评论 4 324
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,324评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,315评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,539评论 1 262
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,578评论 2 355
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,877评论 2 345

推荐阅读更多精彩内容