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.

  • 相关阅读:
    使用C#开发ActiveX控件 并制作Cab包
    asp.net后台创建table设置宽度百分比
    Sql按姓名查出某个人的成绩排名
    获得DataGridView多选框值
    解决iframe窗体丢失Session时登录窗口显示在子页面的问题
    xml返回数组数据
    安卓界面组件文本框
    安卓的UI界面开发(初学者推荐)
    安卓布局
    安卓界面组件按钮
  • 原文地址:https://www.cnblogs.com/andycja/p/14125010.html
Copyright © 2011-2022 走看看