Skip to content

Commit 33f6cc6

Browse files
committed
tweaks
Signed-off-by: Vanessa Sochat <vsochat@stanford.edu>
1 parent 0845c42 commit 33f6cc6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

singularity/build/scripts/secure-build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CONTENDER_STAGES=$(cat $SINGULARITY_BUILDDEF | grep ^[[:blank:]]*Stage:)
1717

1818
# Case 1: We have stages
1919
for stage in $CONTENDER_STAGES; do
20-
if [ "$stage" != "Stage" ]; then
20+
if [ "$stage" != "Stage:" ]; then
2121
stages="$stage $stages"
2222
fi
2323
done
@@ -152,7 +152,6 @@ else
152152
mkdir -p "${SINGULARITY_WORKDIR}$STAGED_BUILD_IMAGE"
153153
echo "none ${STAGED_BUILD_IMAGE} bind dev 0 0" >> "$FSTAB_FILE"
154154
echo "bind path = /tmp/sbuild$stage/fs:$STAGED_BUILD_IMAGE" >> "$TMP_CONF_FILE"
155-
echo "bind path = /tmp/sbuild$stage/fs:$STAGED_BUILD_IMAGE" >> "$TMP_CONF_FILE"
156155
done
157156

158157
# The final stage is where we put the container
@@ -161,6 +160,10 @@ else
161160
# We only use the builder once, make default config
162161
cp "$TMP_CONF_FILE" "${SINGULARITY_confdir}/singularity.conf"
163162

163+
# add final lines of build script
164+
echo "singularity build --no-cleanup $STAGED_BUILD_IMAGE/container.sif $BUILDDEF" >> "${BUILD_SCRIPT}"
165+
echo "exit \$?" >> ${BUILD_SCRIPT}
166+
164167
fi
165168

166169
# Shared final tweaks

0 commit comments

Comments
 (0)