I have been quiet on here as I am in the process of writing again, one of things I have been looking at is Dockers new networking features. This gave me an excuse to have a play with Weave. Rather than go into too much detail here, lets go all click bait because you won’t believe what happened next.

I launched two hosts in Digital Ocean↗ , one in London and then one in New York City using Docker Machine;

Docker Networking Magic 1/9
dmdmoβ€”β€”β€”β€”eoβ€”β€”β€”β€”ecscskddddhkddddheriii-eriii-riggglrigggn-viiio-viiiymetttnmetttcaraaadaraaacllloclllhdooonhdoooiiccciicccngeeengeeeeiaaaeiaaatnnntnnnca---ca---rlarsrlarseoceieoceiaccgzaccgzteeieteeieeasoeasonsn1nsn1-g-gtlbtnbyknkc\e1e2nn\\yyoouurr--ddiiggiittaall--oocceeaann--aappii--ttookkeenn--ggooeess--hheerree\\

Once both hosts were up and running I downloaded the Weave binaries on each host;

Docker Networking Magic 2/9
ddoocckkeerr--mmaacchhiinneesssshhmmeesshh--lnoyncdoβ€˜ncuβ€˜rclur-lL-gLitg.iito./iwoe/awveeaveus/ru/slrclaolc/abli/nb/iwne/awveea;vec;hmcohdmoad+xa+/xus/ru/slrclaolc/abli/nb/iwne/awveea’ve’

Once the binary was on each host, I launched Weave on each host making sure I provided a password so that traffic between the host machines would be encrypted;

Docker Networking Magic 3/9
ddoocckkeerr--mmaacchhiinneesssshhmmeesshh--lnoyncdowneawveeavleaulnacuhncβ€”hpβ€”aspsawsosrwdormd3gma3_g5ae_c5reectr_epta_5p5aw505rwd0rd

Now Weave is running on both my hosts, I instructed the mesh-nyc host to connect to the IP address of the mesh-london host;

Docker Networking Magic 4/9
docker-machinesshmesh-nycweaveconnectβ€œ$(docker-machineipmesh-london)”

and finally check the status of the Weave cluster;

Docker Networking Magic 5/9
docker-machinesshmesh-nycweavestatus

There should be two peers and 2 established connections.

This is where it gets interesting. Launching a NGINX↗ container on the New York City host by running;

Docker Networking Magic 6/9
droβ€”β€”β€”β€”β€”ucsknnhddseaeonnmrmtsssce=t=-k$=wn”se(nea1endgam7adoive2rrcne=.cikx”1hce\n7=kr\g.”/-i0wnmn.egax1aic."vnhwexie\.nalevoecc.aollno”fcia\gl”me\sh-nyc)run-itd\

and then on the London host, try wgetting the page being served by NGINX (its just a plain one which says Hello from NGINX);

Docker Networking Magic 7/9
droβ€”β€”β€”β€”ucskrnddsemennmrtssc\==-k$w”se(e1enda7adov2rrce.cik1hce7=kr.”/-0wbm.eaa1asc"vehei\.wnlgeoectcaol-n”qfi\-gO-mehstht-pl:o/n/dnogni)nxr.uwnea-viet.l\ocal

and then finally ping the NGINX container;

Docker Networking Magic 8/9
droβ€”β€”β€”β€”ucskrnddsemennmrtssc\==-k$w”se(e1enda7adov2rrce.cik1hce7=kr.”/-0wbm.eaa1asc"vehei\.pnlieoncgcaol-n”cfi\3gnmgeisnhx-.lwoenadvoen.)lorcuanl-it\

If you can’t be bothered to run it yourself, and who can blame you, here is anasciicinemaβ†—recording;

asciicast

As you can see, with no effort on my part other than the commands above I had encrypted, multi-host container networkingΒ !!!

black-magic

Don’t forget to get teardown the twoDigital Oceanβ†—hosts if you brought them up;

Docker Networking Magic 9/9
ddoocckkeerr--mmaacchhiinneesrtmopmemsehs-hl-olnodnodnonmemsehs-hn-yncyc

For further reading on Weave Net pleasesee their documentation↗.