浏览代码

Update dind "/tmp" mounting to be optional

This allows someone running the image to use `-v` to mount a non-tmpfs `/tmp` into their image if they so require/desire.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Tianon Gravi 10 年之前
父节点
当前提交
b8bed8832b
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      hack/dind

+ 4 - 2
hack/dind

@@ -105,8 +105,10 @@ if ! grep -qw devices /proc/1/cgroup; then
 	echo >&2 'WARNING: it looks like the "devices" cgroup is not mounted.'
 fi
 
-# Mount /tmp
-mount -t tmpfs none /tmp
+# Mount /tmp (conditionally)
+if ! mountpoint -q /tmp; then
+	mount -t tmpfs none /tmp
+fi
 
 if [ $# -gt 0 ]; then
 	exec "$@"