首页 > 解决方案 > 此地址: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

标签: macosdockerport

解决方案


更新文件## 127.0.0.1 localhost127.0.0.1 localhost的行/etc/hosts

基本上#用于在 bash 中进行评论。

之后,您将能够使用127.0.0.1:5000和访问http://localhost:5000


推荐阅读