


We showed that Weave Net works perfectly with the beta version of Docker for Mac and demonstrated that routing from the Mac to container IP addresses is possible, using a handy BASH script. Using DNS to connect directly from an OSX browser to the test container running inside the host Summary weave.local domain – so this also is registered in Weave DNS and accessible via the browser: Using DNS to connect directly to a container.Īnd the Apache Web Server we started for the original test? The Weave Net plugin for Docker listens for hostnames assigned to the. Here’s the result: Scope is now resolvable using (if you’ve followed along, click the link to open it in your own browser). Weave Scope is reachable at the following URL(s): The routing works, but what about DNS? Scope registers itself in Weave DNS, when present, so let’s launch a Weave Scope instance and see if it’s reachable in the browser: scope launchĦ740576284b7f45e6f982f94c0d1d75e4650803b048a984dbd7d9c0a64648e07 So now let’s test that the routing works: curl Docker released Docker for Mac/Windows which replaces the current Docker Toolbox. The domain name is now used in the DNS resolver configuration.Įxecute the command: sudo mkdir -p /etc/resolver & sudo sh -c 'echo "nameserver 172.17.0.1" >/etc/resolver/weave.local'Īdds the Weave DNS server IP to the Mac’s DNS resolver. The best Docker birthday present we could ask for. Let’s launch Weave and an Apache HTTPD as a target for the connection test: weave launchĭocker run -name=httpd -d -net=weave -hostname= httpdĭocker inspect -f="" When debugging or developing an application it’s incredibly useful to be able to connect an IDE and other developer tools directly to the application service ports – but this can be fiddly if the application is running inside a container. We tried Weave Net and it works just as you’d expect, but Docker’s desire to create a better user experience on the Mac got us thinking – what could we do to make developing containerized applications on a Mac even easier? Debugging by connecting directly to an application The Apple Mac users in the Weave team were excited to see the recent release of the beta version of Docker for Mac and to try out the new xhyve based container host. With a few tiny tweaks to your Mac, you can connect with Docker containers running on Weave Net and Docker for Mac, without exposing ports on the Docker host – which is great for testing and debugging during application development. Debugging and testing containerized applications from a Mac can be fiddly, (because you’re running containers inside a Host, which itself is running inside the OS), especially if you have multiple containers using the same port or if a second port is assigned to a value not known before a process starts (JMX, I’m looking at you).
