zoukankan      html  css  js  c++  java
  • Application Data in Docker 笔记

    Application Data in Docker

    By default all files created inside a container are stored on a writable container layer. This means that: The data doesn't persist when that container no longer exists, and it can be difficult to get the data out of the container if another process needs it. And is low performant.

    Advanced Types: bind, volume, tmpfs
    Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem. Volumes are the best way to persist data in Docker.
    Bind mounts may be stored anywhere on the host system. They may even be important system files or directories. Non-Docker processes on the Docker host or a Docker container can modify them at any time.
    tmpfs mounts are stored in the host system’s memory only, and are never written to the host system’s filesystem.

    Consider a situation where your image starts a lightweight web server. You could use that image as a base image, copy in your website’s HTML files, and package that into another image. Each time your website changed, you’d need to update the new image and redeploy all of the containers serving your website. A better solution is to store the website in a named volume which is attached to each of your web server containers when they start. To update the website, you just update the named volume.

    Multiple containers can use the same volume in the same time period. This is useful if two containers need access to shared data. For example, if one container writes and the other reads the data.

  • 相关阅读:
    在XP下基于VHD版XP 2003 win7制作的RAMOS心得
    联想G480笔记本安装系统
    多路由器环境下路由器的入口IP地址及DHCP设置探讨
    无线路由器工作模式的区别
    Shiro学习
    R语言学习网址
    2018年刑侦科目推理试题
    信息熵
    myeclipse使用步骤总结
    eclipse没有server选项
  • 原文地址:https://www.cnblogs.com/andycja/p/14125010.html
Copyright © 2011-2022 走看看