Skip to content

Commit c197248

Browse files
committed
configure.sh: Handle Podman Docker Wrapper.
1 parent 761c978 commit c197248

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

configure.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,22 @@ check_container_engine() {
5656
fi
5757

5858
touch permission_check
59-
local inner_uid="$($1 run -v "$(pwd):/test$CONTAINER_MOUNT_OPTS" \
59+
60+
# Capture both stdout and stderr
61+
local output="$($1 run -v "$(pwd):/test$CONTAINER_MOUNT_OPTS" \
6062
--rm $2 \
6163
stat --format "%u" /test/permission_check 2>&1)"
6264
rm permission_check
6365

66+
# Filter output to get inner_uid or "Permission denied"
67+
local inner_uid=$(echo "$output" | grep -E '^[0-9]+$|Permission denied')
68+
69+
# Check if inner_uid is not captured or empty
70+
if [ -z "$inner_uid" ]; then
71+
err "Unable to determine UID - received output: $output"
72+
die "Please check your $1 setup."
73+
fi
74+
6475
if [[ $inner_uid == *"Permission denied"* ]]; then
6576
err "The container cannot access files. Are you using SELinux?"
6677
die "Please read README.md and check your $1 setup works."

0 commit comments

Comments
 (0)