

免费资源网 – https://freexyz.cn/
Question
Docker内需要访问本机的数据库,如何访问。使用127.0.0.1肯定是不行的,因为这个在Docker容器里面指的是容器本身。所以,需要走别动渠道进行解决。
Solution
下面几种办法,根据操作系统的类型,选取其一即可。
DockerFile:
RUN /sbin/ip route|awk /default/ { print $3,”tdockerhost” }
© 版权声明
THE END
★喜欢这篇文章吗?喜欢的话,麻烦动动手指支持一下!★
相关推荐
暂无评论内容