Till now, we discussed how effectively data volumes can be used to share data between the Docker host and the containers as well as between containers. Data sharing using data volumes is turning out to be a very powerful and essential tool in the Docker paradigm. However, it does carry a few pitfalls that are to be carefully identified and eliminated. In this section, we make an attempt to list out a few common issues associated with data sharing and the ways and means to overcome them.
Earlier in the data volume section, we learnt that the Docker engine automatically creates directories based on the
VOLUME instruction in
Dockerfile as well as the
-v option of the
docker run subcommand. We also understood ...