====== LU05a - Einführung in Storage mit Containern ====== ===== Ziele ===== -Ich kann erklären, warum ich explizit Storage (Speicher) anlegen muss. -Ich kann Storage (Speicher) anlegen und verwalten. -Ich kann mögliche Fehlermeldung lesen und interpretieren. -Ich kann mindestens eine Massnahme bei Fehlermeldung vorschlagen und umsetzen. \\ ===== How to use storage with container ===== ==== Introduction ==== An efficient storage solution in container environment is as important as all topics mentioned till now. With containers the logic is pretty simple: containers data needs to be backed up somewhere as a permanent storage. {{:modul:m347:learningunits:lu05:storage_1.png?500|Fig-1: Read only layer}} ==== Read-Only vs. Read-Write ==== Take a look at layered structure of docker image and container data. There are two types of layers: * read only layers which hold permanent data and is never modified due to copy on write policy and * read write layers which hold temporary or volatile data. {{:modul:m347:learningunits:lu05:storage_3.png?500|Fig-2: Read only layer}} If a container stops or dies, the volatile data vanishes. {{:modul:m347:learningunits:lu05:storage_4.png?500|Fig-3: Read-Write layer}} We need to back up the important data from the volatile read write layer of the container. Now the next question is where to store the data? Well, just anywhere. Do you want to store it on some machine which hosts docker? Go ahead. Do you want to store it to another server? Go ahead. Do you want to store it on cloud? Go ahead as well. And the last and genuine question which comes to my mind is. ==== Type of storage ==== === Volumes === Most commonly used storage type is called a ''volume''. In a ''volume'', the container storage is completely isolated from the host file system. Although the data of ''volume'' is sorted in a specific directory of the host, they are controlled and managed by docker command line. Compared to other options of storage which we will visit soon enough, ''volume''s are more secure to ship and more reliable to operate.