官术网_书友最值得收藏!

Volume drivers

The same as with network driver plugins, volume plugins extend the capabilities of the Docker engine and enable integration with other types of storage. There are a ton of ready to use plugins available for free on the Internet; you can find a list on Docker's GitHub page. Some of them include:

  • Docker volume driver for Azure file storage: This is a Docker volume driver which uses Azure file storage to mount file shares on the cloud to Docker containers as volumes. It uses the network file sharing (SMB/CIFS protocols) capabilities of Azure file storage. You can create Docker containers that can migrate from one host to another seamlessly or share volumes among multiple containers running on different hosts.
  • IPFS: Open source volume plugin that allows the use of an IPFS filesystem as a volume. IPFS is a very interesting and promising storage system; it makes it possible to distribute high volumes of data with high efficiency. It provides deduplication, high performance, and clustered persistence, providing secure P2P content delivery, fast performance, and decentralized archiving. IPFS provides resilient access to data, independent of low latency or connectivity to the backbone.
  • Keywhiz: You can use this driver to make your container talk to a remote Keywhiz server. Keywhiz is a system for managing and distributing secret data, the same as TLS certificates/keys, GPG keys, API tokens, and database credentials. Instead of putting this data in config files or copying files (which is similarly to be leaked or difficult to track), Keywhiz makes managing it easier and more secure: Keywhiz servers in a cluster centrally store secrets encrypted in a database. Clients use mutually authenticated TLS (mTLS) to retrieve secrets they have access to.

As you can see from the previous examples, they are quite interesting, sometimes even exotic. Because of the extendable nature of Docker and its plugin architecture, you can create very flexible setups. But, third-party drivers do not always introduce completely new storage types; sometimes, they just extend the existing drivers. An example of that can be the Local Persist Plugin, a volume plugin that extends the default local driver's functionality by allowing you to specify a mount point anywhere on the host, which enables the files to always persist, even if the volume is removed via the docker volume rm command.

If you need a volume plugin that is not yet available, you can just write your own. The process is very well documented on Docker's GitHub page, together with extensible examples.

We've now covered how to open our containers to the external world. We can use networking and mounted volumes to be able to share data between containers and other hosts. Let's summarize what we have learned so far in this chapter:

  • We can use the network plugins to further extend the networking data exchange
  • Volumes persist the data, even through container restarts
  • Changes to files on the volume are made directly, but they will not be included when you update an image
  • Data volumes persist even if the container itself is deleted
  • Volumes allow of sharing data between the host filesystem and the Docker container, or between other Docker containers
  • We can use the volume drivers to further extend the file exchange possibilities
Containers from the same Docker host see each other automatically on the default bridge network.
主站蜘蛛池模板: 宁阳县| 中方县| 长乐市| 全州县| 黎平县| 玉屏| 延庆县| 青海省| 惠水县| 肥西县| 长岭县| 沧州市| 康定县| 永安市| 波密县| 黄浦区| 安塞县| 阳信县| 乐都县| 海淀区| 建昌县| 惠来县| 桃园县| 桐城市| 潼南县| 林西县| 清流县| 临桂县| 双牌县| 西安市| 枣阳市| 阳朔县| 商河县| 泗洪县| 霍山县| 莱阳市| 布拖县| 阿拉尔市| 连城县| 敦化市| 桦甸市|