The practicality of data sharing between containers

Earlier in this chapter, you learned the mechanism of accessing the log files of the Apache2 HTTP service from the Docker host. Although it was fairly convenient to share data by mounting the Docker host directory to a container, later we came to know that data can be shared between containers by just using data volumes. So here, we are bringing in a twist to the method of the Apache2 HTTP service log handling by sharing data between containers. To share log files between containers, we will spin off the following containers as enlisted in the following steps:

  1. First, a data-only container that will expose the data volume to other containers.
  2. Then, an Apache2 HTTP service container leveraging ...

Get Learning Docker - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.