mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 04:14:38 +00:00
Reduce image size
This commit is contained in:
@@ -7,18 +7,24 @@ Bind Mount (绑定挂载) 将 **宿主机的目录或文件** 直接挂载到容
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph Host ["宿主机"]
|
||||
direction TB
|
||||
Dir1["/home/user/code/<br/>├── index.html<br/>├── style.css<br/>└── app.js"]
|
||||
Dir1["/home/user/code/"]
|
||||
end
|
||||
|
||||
subgraph Container ["容器"]
|
||||
direction TB
|
||||
Dir2["/usr/share/nginx/html/<br/>(同一份文件)"]
|
||||
Dir2["/usr/share/nginx/html/"]
|
||||
end
|
||||
|
||||
Dir1 <-->|Bind Mount| Dir2
|
||||
```
|
||||
|
||||
目录结构(同一份文件):
|
||||
```text
|
||||
/home/user/code/ (或 /usr/share/nginx/html/)
|
||||
├── index.html
|
||||
├── style.css
|
||||
└── app.js
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 8.2.2 Bind Mount vs Volume
|
||||
|
||||
Reference in New Issue
Block a user