Disable ipv6 / DNS Resolve troubles (#299)

* Disable ipv6

* Disable search domain

* Update network.py

* Update __init__.py

* add options
This commit is contained in:
Pascal Vizeli 2018-01-08 13:57:59 +01:00 committed by GitHub
parent 73c437574c
commit 0c44064926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -47,8 +47,10 @@ class DockerAPI(object):
hostname = kwargs.get('hostname')
# setup network
kwargs['dns_search'] = ["."]
if network_mode:
kwargs['dns'] = [str(self.network.supervisor)]
kwargs['dns_opt'] = ["ndots:0"]
else:
kwargs['network'] = None

View File

@ -52,7 +52,8 @@ class DockerNetwork(object):
ipam_config = docker.types.IPAMConfig(pool_configs=[ipam_pool])
return self.docker.networks.create(
DOCKER_NETWORK, driver='bridge', ipam=ipam_config, options={
DOCKER_NETWORK, driver='bridge', ipam=ipam_config,
enable_ipv6=False, options={
"com.docker.network.bridge.name": DOCKER_NETWORK,
})