Ok, we have a macOS laptop (one of the latest MacBook Pro with the touchID touch bar) where port forwarding does not work. Our tests are fairly simple.
1.- We bringup a container for MariaDB and port forward 3303 to 3306 (docker run --name some-mariadb2 -p 127.0.0.1:3303:3306 -e MYSQL_ROOT_PASSWORD=my_password -d mariadb:10.2.22-bionic)
2.- We attempt to telnet to port 3303 on localhost
On all laptop we see the container running with the proper port forward
{13:42}[2.5.0]~/Documents➭ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a6c53bd9df24 mariadb:10.2.22-bionic "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:3303->3306/tcp some-mariadb2
On the laptop where it’s working when we telnet we get:
{13:49}[2.5.0]~ ➭ telnet localhost 3303
Trying ::1...
Connected to localhost.
Escape character is '^]'.
p
5.5.5-10.2.22-MariaDB-1:10.2.22+maria~bionic
Z3-)&!o2���IVW1-0EM3U5Hmysql_native_password^]
Which is what we are expecting. However on the laptop that it’s not working we get:
$ telnet localhost 3303
Trying ::1...
Connected to localhost.
Escape character is '^]'.
And it just hangs there.
We looked at the macOS firewall (turned-off), turned off any running application that could be suspect.
I’m out of ideas on that one and maybe someone here has something we can try.
Thanks for raising. I’m getting the same issue - I suspect there is a Docker for Mac problem here, probably with the proxy that exposes ports. This is with the stable build, Version 2.0.0.3 (31259).
Hello! In case of someone has not yet solved this issue, this is my workaround:
Happens the docker daemon is not actually running inside of Mac itself like in a Linux box, but inside of a VM (since I installed it from [home]brew, it is running in a VirtualBox instance), so I changed the networking settings of that VM to use the “bridge adapter”, I restarted the VM, then I restarted the docker containers, and now I can access to my containers by addressing them to the IP of their VM. From Mac, the command still docker works.