zoukankan      html  css  js  c++  java
  • Use volumes

    Use volumes

    Volumes are the preferred mechanism for persisting data generated by and used by Docker containers. While bind mounts are dependent on the directory structure of the host machine, volumes are completely managed by Docker. Volumes have several advantages over bind mounts:

    • Volumes are easier to back up or migrate than bind mounts.
    • You can manage volumes using Docker CLI commands or the Docker API.
    • Volumes work on both Linux and Windows containers.
    • Volumes can be more safely shared among multiple containers.
    • Volume drivers let you store volumes on remote hosts or cloud providers, to encrypt the contents of volumes, or to add other functionality.
    • New volumes can have their content pre-populated by a container.

    In addition, volumes are often a better choice than persisting data in a container’s writable layer, because a volume does not increase the size of the containers using it, and the volume’s contents exist outside the lifecycle of a given container.

    If your container generates non-persistent state data, consider using a tmpfs mount to avoid storing the data anywhere permanently, and to increase the container’s performance by avoiding writing into the container’s writable layer.

    Volumes use rprivate bind propagation, and bind propagation is not configurable for volumes.

  • 相关阅读:
    3.css3文字与字体
    2.css3表示颜色的几种方式
    测试ssh转发
    硬盘相关合集,以及LVM操作实践
    linux硬件驱动
    启动nfs清除端口占用过程
    postgres10.2时区研究
    git submodule临时分支;以及git reset使用
    sudo环境变量问题;程序库函数寻找
    linuxI/O重定向
  • 原文地址:https://www.cnblogs.com/chucklu/p/13162998.html
Copyright © 2011-2022 走看看