buildkit 的 bind mount 是只读挂载,rm -rf /tmp/* 会报 'Device or resource busy'。改为 find 排除这两个文件。
@@ -496,7 +496,7 @@ RUN --mount=type=bind,source=pack/third_party/prometheus-3.5.1.linux-amd64.tar.g
cp /opt/grafana/conf/sample.ini /etc/grafana/grafana.ini.sample
rm -rf /var/tmp/* \
- && rm -rf /tmp/* \
+ && find /tmp -mindepth 1 -not -name 'prometheus.tar.gz' -not -name 'grafana.tar.gz' -exec rm -rf {} + \
&& rm -rf /var/cache/apt
EOF