简体   繁体   English

码头工人没有在 OSX 上监听端口 - colima

[英]docker not listening on port on OSX - colima

When trying to map a port with Docker on colima, the map works, but the port is not open for listening on MacOS尝试在 colima 上使用 Docker 映射端口时,该映射有效,但该端口未打开以在 MacOS 上进行侦听

You may end here if you went through this or this other questions and still stuck.如果您经历了这个这个其他问题并且仍然卡住,您可能会在这里结束。

For:为了:

  • OSX操作系统
  • Using colima使用大肠杆菌
  • on M1在 M1 上

A docker container exposing a port will not be listening (checked for example with netstat ) even if docker port \<container\> shows it is.即使docker port \<container\>显示,暴露端口的 docker 容器也不会被监听(例如使用netstat检查)。

Example docker run: docker run -p 80:80 -name mycontainer myimage docker run 示例: docker run -p 80:80 -name mycontainer myimage

What is the solution so that the port is listening in the local host?使端口在本地主机中侦听的解决方案是什么?

The answer is in the Colima FAQ - Enable reachable IP address答案在 Colima 常见问题解答 - 启用可访问的 IP 地址

colima start --network-address

It is only a mechanism for OSX because it asks for an admin pwd to be able to work.它只是 OSX 的一种机制,因为它要求管理员密码才能工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM