user3006967
user3006967

Reputation: 3545

How can I change docker network ip address in Mac

I have met an annoying issue when I run Docker in my Mac and hope to get your help. The issue is my company's internal git repository is on address 172.17.28.245, and this IP address is in conflicts with default docker network IP address, 172.17.0.0. So whenever I am running below command, I am having this issue

Ping git.xxx.net
Then I have 
PING git.xxx.net (172.17.28.245) 56(84) bytes of data.
From 08be4336c264 (172.17.0.2) icmp_seq=1 Destination Host Unreachable
From 08be4336c264 (172.17.0.2) icmp_seq=2 Destination Host Unreachable
From 08be4336c264 (172.17.0.2) icmp_seq=3 Destination Host Unreachable

So, can anyone help me to figure out how I can resolve this issue in mac?

I am using Docker QuickStart Terminal in Mac to start.

Thanks

Upvotes: 5

Views: 9109

Answers (1)

Motin
Motin

Reputation: 5063

In recent versions of Docker for mac, you can change Docker's subnet under Preferences -> Advanced -> Docker subnet.

Set it to 192.168.50.0 for instance.

For even more fine-grained control of subnets used by Docker for mac, go to Preferences -> Daemon -> Advanced and add configuration according to the syntax in this comment:

{ "bip":"xx.xx.xx.x/xx", "dns-search":[" xx.xx.x.xx"], "dns": [" xx.xx.x.xx"," xx.xx.x.xx"] }

Upvotes: 1

Related Questions