Browse code

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 authored on 2015/08/22 07:47:50
Showing 1 changed files
... ...
@@ -105,8 +105,10 @@ if ! grep -qw devices /proc/1/cgroup; then
105 105
 	echo >&2 'WARNING: it looks like the "devices" cgroup is not mounted.'
106 106
 fi
107 107
 
108
-# Mount /tmp
109
-mount -t tmpfs none /tmp
108
+# Mount /tmp (conditionally)
109
+if ! mountpoint -q /tmp; then
110
+	mount -t tmpfs none /tmp
111
+fi
110 112
 
111 113
 if [ $# -gt 0 ]; then
112 114
 	exec "$@"