Add blank lines before headers

This commit is contained in:
yeasy
2026-03-21 12:57:51 -07:00
parent 0648f63979
commit 312f8fea42
76 changed files with 411 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ RUN echo {a..z}
默认情况下管道命令 `cmd1 | cmd2` 只要 `cmd2` 成功整个指令就视为成功这可能掩盖构建错误
```docker
## ❌ 这里的 wget 失败了,但构建继续(因为 tar 成功了)
RUN wget -O - https://invalid-url | tar xz
@@ -46,6 +47,7 @@ RUN wget -O - https://invalid-url | tar xz
使用 `SHELL` 启用 `pipefail`
```docker
## ✅ 启用 pipefail
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@@ -90,11 +92,13 @@ FROM ubuntu:24.04
RUN echo "Using sh"
SHELL ["/bin/bash", "-c"]
## 使用 bash
RUN echo "Using bash"
SHELL ["/bin/sh", "-c"]
## 回到 sh
RUN echo "Using sh again"