昨天我为osx安装了docker-beata(https://beta.docker.com/)。到目前为止,这看起来不错,但是容器之间定义的链接仍然无法立即使用,例如,它们各自的DNS名称似乎无法解析。
如何使用docker-beta更改此设置,以使链接容器的dns名称在(osx / windows)主机上可用?
links:
- someName
pinata list
返回以下内容,而将ping
转换为docker.local
失败,并显示unknown host
🐳 hostname = docker
Hostname of the virtual machine endpoint, where container ports will be
exposed if using nat networking. Access it via 'docker.local'.
🐳 hypervisor = native (memory=8, ncpu=4)
The Docker.app includes embedded hypervisors that run the virtual machines
that power the containers. This setting allows you to control which the
default one used for Linux is.
▸ native: a version of the xhyve hypervisor that uses the MacOSX
Hypervisor.framework to run container VMs. Parameters:
memory (VM memory in gigabytes), ncpu (vCPUs)
🐳 network = hostnet (docker-ipv4=192.168.65.2, host-ipv4=192.168.65.1)
Controls how local containers can access the external network via the
MacOS X host. This includes outbound traffic as well as publishing ports
for external access to the local containers.
▸ hostnet: a mode that helps if you are using a VPN that restricts
connectivity. Activating this mode will proxy container network
packets via the Docker.app process as host socket traffic.
Parameters: docker-ipv4 (docker node), host-ipv4 (host node)
▸ nat: a mode that uses the MacOS X vmnet.framework to route container
traffic to the host network via a NAT.
🐳 filesystem = osxfs
Controls the mode by which files from the MacOS X host and the container
filesystem are shared with each other.
▸ osxfs: a FUSE-based filesystem that bidirectionally forwards OSX
filesystem events into the container.
🐳 native/port-forwarding = true
Expose container ports on the Mac, rather than the VM
▸ true: Container ports will be exposed on the Mac
▸ false: Container ports will be exposed on the VM
🐳 daemon = run 'pinata get daemon' or 'pinata set daemon [@file|-]>
JSON configuration of the local Docker daemon. Configure any custom
options you need as documented in:
https://docs.docker.com/engine/reference/commandline/daemon/. Set it
directly, or a @file or - for stdin.
这里用旧的docker https://github.com/databricks/spark-integration-tests描述
With boot2docker, the Docker containers will be run inside of a VirtualBox VM, which creates some difficulties for communication between the Mac host and the containers. Follow these instructions to work around those issues:
Network access: Our tests currently run the SparkContext from outside of the containers, so we need both host <-> container and container <-> container networking to work properly. This is complicated by the fact that boot2docker runs the containers behind a NAT in VirtualBox.
One workaround is to add a routing table entry that routes traffic to containers to the VirtualBox VM's IP address:
sudo route -n add 172.17.0.0/16
boot2docker ip
You'll have to re-run this command if you restart your computer or assign a new IP to the VirtualBox VM.
但这不再起作用,因为docker-beata已在主机网中运行
最佳答案
我也遇到了这个问题,在禁用OS X防火墙后它似乎已解决
我发誓我看到了一些将可执行文件列入白名单的文档,而不是禁用防火墙,但是我找不到它...
关于macos - osx dns上的docker beta用于容器之间的链接不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37073740/