Fix Docker-based Development Workflow (#1031)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
YGoetschel
2025-12-11 12:48:14 +01:00
committed by GitHub
parent 1a4e95e940
commit 997f54e700
5 changed files with 162 additions and 13 deletions
+30 -1
View File
@@ -13,6 +13,8 @@ elif [ "${1#-}" != "$1" ]; then
elif [ "$1" = "rustfs" ]; then
shift
set -- /usr/bin/rustfs "$@"
elif [ "$1" = "cargo" ]; then
: # Pass through cargo command as-is
else
set -- /usr/bin/rustfs "$@"
fi
@@ -22,8 +24,35 @@ DATA_VOLUMES=""
process_data_volumes() {
VOLUME_RAW="${RUSTFS_VOLUMES:-/data}"
# Convert comma/tab to space
VOLUME_LIST=$(echo "$VOLUME_RAW" | tr ',\t' ' ')
VOLUME_LIST_RAW=$(echo "$VOLUME_RAW" | tr ',\t' ' ')
VOLUME_LIST=""
for vol in $VOLUME_LIST_RAW; do
# Helper to manually expand {N..M} since sh doesn't support it on variables
if echo "$vol" | grep -E -q "\{[0-9]+\.\.[0-9]+\}"; then
PREFIX=${vol%%\{*}
SUFFIX=${vol##*\}}
RANGE=${vol#*\{}
RANGE=${RANGE%\}}
START=${RANGE%%..*}
END=${RANGE##*..}
# Check if START and END are numbers
if [ "$START" -eq "$START" ] 2>/dev/null && [ "$END" -eq "$END" 2>/dev/null ]; then
i=$START
while [ "$i" -le "$END" ]; do
VOLUME_LIST="$VOLUME_LIST ${PREFIX}${i}${SUFFIX}"
i=$((i+1))
done
else
# Fallback if not numbers
VOLUME_LIST="$VOLUME_LIST $vol"
fi
else
VOLUME_LIST="$VOLUME_LIST $vol"
fi
done
for vol in $VOLUME_LIST; do
case "$vol" in
/*)