简体   繁体   中英

How do I connect to a docker container running on a different host on a mac?

I have set up docker on my Mac using Kinematic. I have a mysql container running.

So, the 'schematic', I believe, looks like this: (Mac1 (VirtualBox Docker Host (MySQL Container))).

Mac1 IP: 10.10.10.100 MySQL Container: 192.168.99.100 running on port 32500 (mapped to 3306)

I can access the MySQL server via 192.168.99.100:32500 from Mac1 without any issues.

Now, when I go to Mac2 on my network, I cannot access the MySQL container.

So, Mac2 IP: 10.10.10.200 cannot see 192.168.99.100:32500. Mac2 gets a ping response, but not sure if it is getting all the way to the MySQL Container.

I'm thinking of installing a proxy on Mac1, but wanted to check first.

None of the questions posed here seemed to account for a Kinematic install on a Mac, and the ones referring to boot2docker didn't address the question either.

Any insights would be most welcome! Thanks in advance.

如果您正在寻找将容器端口公开到网络的最简单方法,则可以将虚拟盒端口映射到mac1并从外部访问它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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