@@ -20,24 +20,25 @@ echo "🏗️ Building setup container..."
2020docker build -f Dockerfile.setup -t snapshotter-lite-setup:latest .
2121
2222# Create a temporary file to capture the env file path from setup
23- SETUP_RESULT_FILE=$( mktemp)
23+ SETUP_RESULT_DIR=$( mktemp -d " $( pwd) /setup_result.XXXXXX" )
24+ SETUP_RESULT_FILE=" $SETUP_RESULT_DIR /setup_result"
2425
2526# Run setup container directly
2627echo " 🔧 Running setup container to configure environment..."
2728docker run --rm -it \
2829 -v " $( pwd) :/app" \
29- -v " $SETUP_RESULT_FILE :/tmp/setup_result " \
30+ -v " $SETUP_RESULT_DIR :/tmp/setup_result_dir " \
3031 -w /app \
3132 snapshotter-lite-setup:latest \
32- bash -c " ./configure-environment.sh $SETUP_ARGS --docker-mode"
33+ bash -c " ./configure-environment.sh $SETUP_ARGS --docker-mode --result-file /tmp/setup_result_dir/setup_result "
3334
3435# Remove the setup container image
3536docker rmi snapshotter-lite-setup:latest
3637
3738# Check if setup was successful by reading the result file
3839if [ -f " $SETUP_RESULT_FILE " ] && [ -s " $SETUP_RESULT_FILE " ]; then
3940 SELECTED_ENV_FILE=$( cat " $SETUP_RESULT_FILE " )
40- rm -f " $SETUP_RESULT_FILE "
41+ rm -rf " $SETUP_RESULT_DIR "
4142
4243 if [ -n " $SELECTED_ENV_FILE " ] && [ -f " $SELECTED_ENV_FILE " ]; then
4344 echo " ℹ️ Setup container configured: $SELECTED_ENV_FILE "
@@ -49,7 +50,7 @@ if [ -f "$SETUP_RESULT_FILE" ] && [ -s "$SETUP_RESULT_FILE" ]; then
4950 fi
5051else
5152 echo " ❌ Setup container did not complete successfully or failed to report results."
52- rm -f " $SETUP_RESULT_FILE "
53+ rm -rf " $SETUP_RESULT_DIR "
5354 exit 1
5455fi
5556
0 commit comments