From b3d0f48343f8ae5557b5f80d27165b4973cf3aa5 Mon Sep 17 00:00:00 2001 From: Dima Ryazanov Date: Fri, 3 Jan 2020 14:37:33 -0800 Subject: [PATCH] Only use IPv4 nameservers on Mac (#1482) Workaround for a Docker bug: https://github.com/docker/for-mac/issues/1432 --- api/python/quilt3/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/python/quilt3/main.py b/api/python/quilt3/main.py index 93bc6411c89..d6e395fb0ac 100644 --- a/api/python/quilt3/main.py +++ b/api/python/quilt3/main.py @@ -66,7 +66,11 @@ def _launch_local_s3proxy(): # Workaround for a Docker-for-Mac bug in which the container # ends up with a different DNS server than the host. - command += ["--dns", dns_resolver.nameservers[0]] + # Workaround #2: use only IPv4 addresses. + if sys.platform == 'darwin': + nameservers = [ip for ip in dns_resolver.nameservers if ip.count('.') == 3] + command += ["--dns", nameservers[0]] + command += ["-p", "5002:80", "quiltdata/s3proxy"] subprocess.Popen(command)