mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 20:31:18 +00:00
chore: remove unused historic image files
This commit is contained in:
@@ -21,6 +21,7 @@ ONBUILD <其它指令>
|
||||
#### 场景:维护 Node.js 项目
|
||||
|
||||
假设你有多个 Node.js 项目,它们的构建流程都一样:
|
||||
|
||||
1. 创建目录
|
||||
2. 复制 `package.json`
|
||||
3. 执行 `npm install`
|
||||
@@ -119,6 +120,7 @@ ONBUILD COPY dist/ /usr/share/nginx/html/
|
||||
#### 1。继承性限制
|
||||
|
||||
`ONBUILD` 指令**只会继承一次**。
|
||||
|
||||
- 镜像 A (含 ONBUILD)
|
||||
- 镜像 B (FROM A) -> 触发 ONBUILD
|
||||
- 镜像 C (FROM B) -> **不会**再次触发 ONBUILD
|
||||
|
||||
Reference in New Issue
Block a user