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>
| ... | ... |
@@ -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 "$@" |