pengwk / Docker-Note

Docker笔记
0 stars 0 forks source link

Manage application data #4

Open pengwk opened 6 years ago

pengwk commented 6 years ago

obscured 掩盖

pengwk commented 6 years ago

This example is contrived to be extreme 人为的

pengwk commented 6 years ago

Mounting into a non-empty directory on the container 从host挂载一个文件夹到容器的非空文件夹,会覆盖容器文件夹的内容。--mount type=bind,source=/tmp,target=/usr \

pengwk commented 6 years ago

propagated back 反向传播

pengwk commented 6 years ago

commas 逗号

pengwk commented 6 years ago

bind-mount 和volume都支持只读功能

pengwk commented 6 years ago

-v or --volume 已经不推荐使用了,mount与他们的行为不太一样。前者挂载一个host上不存在的文件或文件夹时,会自动在host上创建一个文件夹,后者会报错。

pengwk commented 6 years ago

the artifacts are saved into another directory 工件

pengwk commented 6 years ago

simultaneously 同时的

pengwk commented 6 years ago

A given volume can be mounted into multiple containers simultaneously. When no running container is using a volume, the volume is still available to Docker and is not removed automatically. You can remove unused volumes using docker volume prune.

pengwk commented 6 years ago

When you create a volume, it is stored within a directory on the Docker host. When you mount the volume into a container, this directory is what is mounted into the container. This is similar to the way that bind mounts work, except that volumes are managed by Docker and are isolated from the core functionality of the host machine.

pengwk commented 6 years ago

Bind mounts and volumes can both mounted into containers using the -v or --volume flag 怎么区分呢?

pengwk commented 6 years ago

decouple叫解耦,学到一个新词

pengwk commented 6 years ago

copy on write 写时复制

pengwk commented 6 years ago

Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.

pengwk commented 6 years ago

Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.

pengwk commented 6 years ago

internal volume 和挂载上去的本地目录有什么不同,两种方式的Dockerfile怎么写?

pengwk commented 6 years ago

Caveats警告注意事项