wiki-ingest batch: n8n Docker / Cloud Operating Model / MinIO+Zipline / Trae Remote SSH (2026-04-15 PM)
This commit is contained in:
28
wiki/concepts/Bind-Mount.md
Normal file
28
wiki/concepts/Bind-Mount.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
id: Bind-Mount
|
||||
title: "Bind Mount"
|
||||
type: concept
|
||||
tags: [docker, storage, development]
|
||||
sources: []
|
||||
last_updated: 2026-04-15
|
||||
---
|
||||
|
||||
## Definition
|
||||
Bind Mount(绑定挂载)是 Docker 的一种存储卷类型,将宿主机文件系统上的特定目录/文件直接映射到容器内,容器内对此路径的读写操作直接作用于宿主机文件系统,实现代码修改实时生效。
|
||||
|
||||
## vs Named Volume
|
||||
| 维度 | Bind Mount | Named Volume |
|
||||
|------|-----------|-------------|
|
||||
| 数据位置 | 宿主机任意路径 | Docker 管理(/var/lib/docker/volumes) |
|
||||
| 适用场景 | 开发(代码热更新) | 生产(数据持久化) |
|
||||
| 可移植性 | 依赖宿主机路径 | Docker 自动管理 |
|
||||
| 备份 | 随宿主机备份 | 需单独备份 |
|
||||
|
||||
## Use Case
|
||||
- 开发环境:宿主机源码目录挂载到容器内,修改文件无需重建镜像
|
||||
- 生产环境:使用 Named Volume 或直接使用 Synology NAS 存储路径
|
||||
|
||||
## Related Concepts
|
||||
- [[Docker Compose]]:定义 Bind Mount 的方式
|
||||
- [[Docker Attach模式]]:Attach 模式适合 Bind Mount 开发
|
||||
- [[Synology NAS]]:NAS 存储路径直接挂载到容器(/volume1/docker/...)
|
||||
Reference in New Issue
Block a user