Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

You may end here if you went through this or this other questions and still stuck.

For:

  • OSX
  • Using colima
  • on M1

A docker container exposing a port will not be listening (checked for example with netstat) even if docker port \<container\> shows it is.

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

What is the solution so that the port is listening in the local host?

like image 673
Efren Avatar asked Sep 14 '25 20:09

Efren


2 Answers

The answer is in the Colima FAQ - Enable reachable IP address

colima start --network-address

It is only a mechanism for OSX because it asks for an admin pwd to be able to work.

like image 125
Efren Avatar answered Sep 17 '25 12:09

Efren


This problem suddenly happened to me, which was odd cause I'd been running docker containers and accessing them via localhost:port.

I tried a bunch of things but stopping and starting colima is what finally did it for me.

like image 28
Tina Maria Avatar answered Sep 17 '25 11:09

Tina Maria