eBooks/eGuides

Containers for Dummies

Issue link: https://insights.oneneck.com/i/1293607

Contents of this Issue

Navigation

Page 46 of 76

CHAPTER 5 Docker Installation and Deployment 43 These materials are © 2017 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited. Any changes to that specific container are retained even between starts and stops of that container. If you ever remove the container, however, say goodbye to your data. This behavior is where the myth that "containers are state- less" originated. Although this is true to a point, containers are far from stateless while they're running and, often, the service running inside the container needs to be able to store data that will persist even upon the deletion of that container. This is where data volumes come into play. A volume is a storage target that resides outside a container. Data saved to a volume persists long after a container has left this world. You can use these data volumes across containers. You can also mount directories from the host's file system, but this storage method is not recommended because you can't use this technique in Docker files. Instead, you must connect to the directory at runtime. If you're coming back to Docker after a hiatus, you may be used to building a container and then adding a volume, which then stays around even if the container goes away. Today, that's all a bit different. In modern Docker, volumes are their own stand- alone atomic units, and you can always attach containers to it. Volumes now remain persistent without the need for administra- tor intervention. But you probably already have a storage area network (SAN) that you like, and you might want to be able to leverage some of its built-in capabilities, such as data reduction and replication. Plus, standalone SANs provide far more scalability than other storage models. What if you'd like persistent storage that can span hosts? Although you can use OS storage protocols such as NFS, having the ability to more deeply integrate with your storage vendor is increasingly important and desirable. Docker and the open-source and vendor communities are mak- ing available a growing number of volume plug-ins. Plug-ins are tools that extend the capabilities of the Docker Engine. Volume plug-ins can enable you to leverage external storage that you can easily share among all your Docker hosts.

Articles in this issue

Archives of this issue

view archives of eBooks/eGuides - Containers for Dummies