juechafun/Untitled 20.md

36 lines
841 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
#领域/未知
#复盘/0 #临时/备忘 #状态/待处理
20260511-备忘-主题名-文件内容
## 一句话描述
[________]
---
### 方案 2临时禁用交互模式快速修复
通过 `DEBIAN_FRONTEND=noninteractive` 临时关闭 `apt` 的交互提示,构建完成后重置变量:
dockerfile
```
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git wget unzip openssh-server tzdata && \
apt-get clean && rm -rf /var/lib/apt/lists/*
```
⚠️ 注意:这个变量会影响后续所有 `apt` 命令,建议只在安装时临时设置,构建完成后重置:
dockerfile
```
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y git wget unzip openssh-server tzdata
ENV DEBIAN_FRONTEND=dialog
```
### 方案 3使用 `--assume-yes` + 预配置(更