Networking

Networking is an important aspect of Docker architecture since we often have to provide communication between applications running on different containers. A common use case may be a web application that needs access to a database. We're now going to refer to another example that has already been introduced in Chapter 11, Message Driven Microservices. It is communication between Apache Kafka and ZooKeeper. Kafka requires ZooKeeper because it stores a variety of configuration as a key/value pair in the ZK data tree and uses it across the cluster. As you may remember, we first had to create a custom network and run those two containers there. The following command is used to create a user-defined network on a Docker host:

$ docker ...

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.