Reduce image size

This commit is contained in:
Baohua Yang
2026-02-27 19:23:28 -08:00
parent bbfc9d34ff
commit 19aaad591c
25 changed files with 52 additions and 28 deletions

View File

@@ -64,7 +64,7 @@ FROM scratch
RUN echo '<h1>Hello, Docker!</h1>' > /usr/share/nginx/html/index.html
```
* *exec* 格式`RUN ["可执行文件", "参数1", "参数2"]`这更像是函数调用中的格式
* *exec* 格式`RUN [可执行文件, 参数1, 参数2]`这更像是函数调用中的格式
Dockerfile 中每一个指令都会建立一层`RUN` 也不例外每一个 `RUN` 的行为就和刚才我们手工建立镜像的过程一样新建立一层在其上执行这些命令执行结束后`commit` 这一层的修改构成新的镜像