fix(build): skip -features flag when empty

Fixes '400 too many arguments' error when creating privileged containers without nesting/fuse features enabled.
This commit is contained in:
CanbiZ
2025-12-11 08:07:05 +01:00
parent 7dcb2fa985
commit d2ea55baa2

View File

@ -2630,10 +2630,15 @@ build_container() {
export DEV_MODE_DRYRUN="${DEV_MODE_DRYRUN:-false}"
# Build PCT_OPTIONS as multi-line string
PCT_OPTIONS_STRING=" -features $FEATURES
-hostname $HN
PCT_OPTIONS_STRING=" -hostname $HN
-tags $TAGS"
# Only add -features if FEATURES is not empty
if [ -n "$FEATURES" ]; then
PCT_OPTIONS_STRING=" -features $FEATURES
$PCT_OPTIONS_STRING"
fi
# Add storage if specified
if [ -n "$SD" ]; then
PCT_OPTIONS_STRING="$PCT_OPTIONS_STRING