Parcourir la source

fix(docker): 清理 /tmp 时排除 prometheus/grafana 挂载点

buildkit 的 bind mount 是只读挂载,rm -rf /tmp/* 会报
'Device or resource busy'。改为 find 排除这两个文件。
kinglee il y a 1 semaine
Parent
commit
9540d03a48
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      pack/Dockerfile

+ 1 - 1
pack/Dockerfile

@@ -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