macos - 此地址:Mac Catalina 上的 127.0.0.1:5000 不工作(docker)但在 Windows 上工作
问题描述
这个地址:127.0.0.1:5000
在 Mac Catalina 上不工作(docker)但在 Windows 上工作。
问题:
如何访问端口:5000 在我的 MAC 上工作?
# Host Database # # localhost is used to configure the loopback
interface # when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the
container: 127.0.0.1 kubernetes.docker.internal
# End of section
解决方案
更新文件## 127.0.0.1 localhost
中127.0.0.1 localhost
的行/etc/hosts
。
基本上#用于在 bash 中进行评论。
之后,您将能够使用127.0.0.1:5000
和访问http://localhost:5000
推荐阅读
- c# - GetHashCode() - 不可变的值?
- visual-studio - 在一个解决方案中构建和运行两个项目
- image-processing - 如何在这张图片中分离这两个边界?
- php - 在ajax中使用设置间隔时滚动到顶部
- node.js - 当我需要导入像 const promise = require ('promise') 这样的承诺以具有 .then 的属性时
- c# - 将本机结构定义导出到托管代码
- regex - 用于在 Notepad++ 中基于另一个文本替换文本的正则表达式
- excel - 为什么 AutoSum 命令不起作用?
- python - 从脚本中的会话转移到在同一会话上打开 selenium 浏览器(和无头浏览器)
- c++ - 删除后我的根似乎没有更新