Open pengwk opened 6 years ago
This example is contrived to be extreme 人为的
Mounting into a non-empty directory on the container 从host挂载一个文件夹到容器的非空文件夹,会覆盖容器文件夹的内容。--mount type=bind,source=/tmp,target=/usr \
propagated back 反向传播
commas 逗号
bind-mount 和volume都支持只读功能
-v or --volume 已经不推荐使用了,mount与他们的行为不太一样。前者挂载一个host上不存在的文件或文件夹时,会自动在host上创建一个文件夹,后者会报错。
the artifacts are saved into another directory 工件
simultaneously 同时的
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.
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.
Bind mounts and volumes can both mounted into containers using the -v or --volume flag 怎么区分呢?
decouple叫解耦,学到一个新词
copy on write 写时复制
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.
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.
internal volume 和挂载上去的本地目录有什么不同,两种方式的Dockerfile怎么写?
Caveats警告注意事项
obscured 掩盖