fix(content): harden copy-paste safety examples

This commit is contained in:
yeasy
2026-05-27 18:17:24 -07:00
parent 3a9ee19d22
commit f09e800020
4 changed files with 30 additions and 20 deletions
+3 -1
View File
@@ -158,9 +158,11 @@ RUN --mount=type=cache,target=/go/pkg/mod \
```docker
RUN --mount=type=secret,id=mysecret \
cat /run/secrets/mysecret
my-private-tool --token-file /run/secrets/mysecret
```
不要在构建命令中 `cat``echo` 或打印密钥内容应把 `/run/secrets/<id>` 路径交给真正消费密钥的工具
#### 3. Heredoc 语法
BuildKit 支持使用 heredoc 语法编写多行脚本无需行末反斜杠 `\` 连接