dockerd-rootless-setuptool.sh: let --force ignore smoke test errors

Now `dockerd-rootless-setuptool.sh install --force` ignores errors
from `rootlesskit`.

This might be useful when installing Rootless Docker into a container
image with `RUN` instructions.

Fix issue 48678

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2024-10-18 00:11:59 +09:00
parent 6649a32cb3
commit fafdcd1194

View File

@@ -399,8 +399,12 @@ cmd_entrypoint_install() {
# check RootlessKit functionality. RootlessKit will print hints if something is still unsatisfied.
# (e.g., `kernel.apparmor_restrict_unprivileged_userns` constraint)
if ! rootlesskit true; then
ERROR "RootlessKit failed, see the error messages and https://rootlesscontaine.rs/getting-started/common/ ."
if [ -z "$OPT_FORCE" ]; then
ERROR "RootlessKit failed, see the error messages and https://rootlesscontaine.rs/getting-started/common/ . Set --force to ignore."
exit 1
else
WARNING "RootlessKit failed, see the error messages and https://rootlesscontaine.rs/getting-started/common/ ."
fi
fi
if [ -z "$SYSTEMD" ]; then