1216 - docker ip

又学到一点。

Grafana 中连接本地的 postgres 数据库,不能直接使用 localhost 或 127.0.0.1,而要使用 docker 的本地 ip 地址。

具体的,可使用 ip add | grep docker0 这一命令,结果中类似 inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0 中的 172.17.0.1,即是 docker 的本地 ip 地址。