fix: flags for read-only and recursive slave mount (#2086)

closes #2083
This commit is contained in:
Fred Fu authored and GitHub committed 2026-05-04 11:10:30 +02:00
1 parent 46d046b095
commit 892f93baaa
1 file changed
+3 -1
+3 -1
View File
@@ -678,8 +678,10 @@ generate_create_command()
# so rslave/rshared bind propagation is not supported.
if [ "$(uname -s)" = "Darwin" ]; then
rslave=""
rorslave=":ro"
else
rslave=":rslave"
rorslave=":ro,rslave"
fi
# Set the container hostname the same as the container name.
@@ -751,7 +753,7 @@ generate_create_command()
tr ',' '\n' | grep -q "^ro$"; then
result_command="${result_command}
--volume ${rootdir}:/run/host${rootdir}:ro${rslave}"
--volume ${rootdir}:/run/host${rootdir}${rorslave}"
continue
fi