Skip to content

Commit 56398e6

Browse files
committed
cmd-build-with-buildah: use a predictable tmp dir
This means that if the process gets interrupted the next invocation will clean up the temporary directory before continuing. I noticed that locally I had a bunch of these directories laying around eating up a decent amount of space.
1 parent 95e9829 commit 56398e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cmd-build-with-buildah

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ fi
102102
build_with_buildah() {
103103
echo "Building with container runtime (buildah) with VERSION=${VERSION}..."
104104

105-
tempdir=$(mktemp -d --tmpdir=tmp "build-with-buildah.XXXXXXXX")
105+
# Allocate temporary space for this build
106+
tempdir="$(pwd)/tmp/build-with-buildah"
107+
rm "${tempdir}" -rf
108+
mkdir "${tempdir}"
106109

107110
# the config dir virtiofs mount is mounted ro; copy it to the tempdir
108111
cp -r src/config/ "${tempdir}/src"

0 commit comments

Comments
 (0)